Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: remoting/host/plugin/host_script_object.cc

Issue 10868031: Limit the ports used by IT2Me when NAT traversal is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move default min & max port definitions to NetworkSettings. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/plugin/host_script_object.cc
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index 1f83dcde3c6b5cac3e911324757c444b62f31c6a..a53eea67414d3831bb04aeb696785c8afb5aa901 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -576,15 +576,22 @@ void HostNPScriptObject::FinishConnectNetworkThread(
signal_strategy_.reset(signal_strategy.release());
register_request_.reset(register_request.release());
- // Create the Host.
+ // If NAT traversal is off then limit port range to allow firewall pin-holing.
LOG(INFO) << "NAT state: " << nat_traversal_enabled_;
+ NetworkSettings network_settings(
+ nat_traversal_enabled_ ?
+ NetworkSettings::NAT_TRAVERSAL_ENABLED :
+ NetworkSettings::NAT_TRAVERSAL_DISABLED);
+ if (!nat_traversal_enabled_) {
+ network_settings.min_port = NetworkSettings::kDefaultMinPort;
+ network_settings.max_port = NetworkSettings::kDefaultMaxPort;
+ }
+
+ // Create the Host.
host_ = new ChromotingHost(
host_context_.get(), signal_strategy_.get(), desktop_environment_.get(),
- CreateHostSessionManager(
- NetworkSettings(nat_traversal_enabled_ ?
- NetworkSettings::NAT_TRAVERSAL_ENABLED :
- NetworkSettings::NAT_TRAVERSAL_DISABLED),
- host_context_->url_request_context_getter()));
+ CreateHostSessionManager(network_settings,
+ host_context_->url_request_context_getter()));
host_->AddStatusObserver(this);
log_to_server_.reset(
new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get()));

Powered by Google App Engine
This is Rietveld 408576698