diff options
author | guoweis <guoweis@chromium.org> | 2015-02-19 06:54:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-19 14:55:34 +0000 |
commit | 7c98bab02128ae9fdc4fcc9a9df38588af86290e (patch) | |
tree | 2a54e876795939bf14324d56a86ff1ca2a23ce9e /content/renderer/p2p | |
parent | 7431bb2983db683dcc4556e1918556254c3d5589 (diff) | |
download | chromium_src-7c98bab02128ae9fdc4fcc9a9df38588af86290e.zip chromium_src-7c98bab02128ae9fdc4fcc9a9df38588af86290e.tar.gz chromium_src-7c98bab02128ae9fdc4fcc9a9df38588af86290e.tar.bz2 |
Add a Preference to allow WebRTC only bind to "any address" (all 0s). This way, no local IP or private ISP's public IP leaked when VPN is the default route.
Add webrtc.multiple_routes_disabled preference to RendererPreferences. Default is false. When set to true, a new port allocator flag will be passed to P2PPortAllocator which will have WebRTC only bind to all 0s (any address) IP and the default route will be used as how chrome/http is routed.
Each rtc_peer_connection_handler is associated with a WebFrame and it leads to a webview and then the mapping RenderViewImpl which has RendererPreferences that we care.
The corresponding webrtc change is at https://webrtc-codereview.appspot.com/39129004
BUG=333752
Review URL: https://codereview.chromium.org/916873004
Cr-Commit-Position: refs/heads/master@{#317047}
Diffstat (limited to 'content/renderer/p2p')
-rw-r--r-- | content/renderer/p2p/port_allocator.cc | 2 | ||||
-rw-r--r-- | content/renderer/p2p/port_allocator.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc index 7beb3ecc..488df30 100644 --- a/content/renderer/p2p/port_allocator.cc +++ b/content/renderer/p2p/port_allocator.cc @@ -31,6 +31,8 @@ P2PPortAllocator::P2PPortAllocator( uint32 flags = 0; if (config_.disable_tcp_transport) flags |= cricket::PORTALLOCATOR_DISABLE_TCP; + if (!config_.enable_multiple_routes) + flags |= cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION; set_flags(flags); set_allow_tcp_listen(false); } diff --git a/content/renderer/p2p/port_allocator.h b/content/renderer/p2p/port_allocator.h index 3cb1377..057f37b 100644 --- a/content/renderer/p2p/port_allocator.h +++ b/content/renderer/p2p/port_allocator.h @@ -36,6 +36,9 @@ class P2PPortAllocator : public cricket::BasicPortAllocator { // Disable TCP-based transport when set to true. bool disable_tcp_transport; + + // Disable binding to individual NICs when set to false. + bool enable_multiple_routes; }; P2PPortAllocator(P2PSocketDispatcher* socket_dispatcher, |