diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 23:58:58 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 23:58:58 +0000 |
commit | 56235947f2b023fc63cfad692c56df4e92199848 (patch) | |
tree | f7c674c90ecd481aca7a078fb5651a1050f31e63 /remoting/host/plugin/host_script_object.cc | |
parent | dd2def67f9485354f6bf937994ebd3de524b9286 (diff) | |
download | chromium_src-56235947f2b023fc63cfad692c56df4e92199848.zip chromium_src-56235947f2b023fc63cfad692c56df4e92199848.tar.gz chromium_src-56235947f2b023fc63cfad692c56df4e92199848.tar.bz2 |
Limit the ports used by IT2Me when NAT traversal is disabled.
BUG=132785
Review URL: https://chromiumcodereview.appspot.com/10868031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153353 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/plugin/host_script_object.cc')
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index 1f83dcd..a53eea6 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())); |