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

Issue 2989303002: Make Port (and subclasses) fully "Network"-based, instead of IP-based. (Closed)

Created:
3 years, 4 months ago by Taylor Brandstetter
Modified:
3 years, 4 months ago
Reviewers:
Zhi Huang
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Make Port (and subclasses) fully "Network"-based, instead of IP-based. For ICE, we want sockets that are bound to specific network interfaces, rather than to specific IP addresses. So, a while ago, we added a "Network" class that gets passed into the Port constructor, in addition to the IP address as before. But we never finished the job of removing the IP address field, such that a Port only guarantees something about the network interface it's associated with, and not the specific IP address it ends up with. This CL does that, and as a consequence, if a port ends up bound to an IP address other than the "best" one (returned by Network::GetBestIP), this *won't* be treated as an error. This is relevant to Android, where even though we pass an IP address into "Bind" as a way of identifying the network, the socket actually gets bound using "android_setsocknetwork", which doesn't provide any guarantees about the IP address. So, if a network interface has multiple IPv6 addresses (for instance), we may not correctly predict the one the OS will choose, and that's ok. This CL also moves "SetAlternateLocalAddress" from VirtualSocket to VirtualSocketServer, which makes for much more readable test code. The next step, if there is one, is to pass along the Network class all the way to SocketServer::Bind. Then the socket server could do smart things with the network information. We could even stick a platform- specific network handle in the Network object, such that the socket server could use it for the binding, or for "sendmsg", for example. See bug 7026 for more context about the sendmsg idea. BUG=webrtc:7715 Review-Url: https://codereview.webrtc.org/2989303002 Cr-Commit-Position: refs/heads/master@{#19251} Committed: https://chromium.googlesource.com/external/webrtc/+/5c3c104ba0f843b9c46a921c8d6c2bd6c068acd2

Patch Set 1 #

Patch Set 2 : Fixing a comment. #

Total comments: 2

Patch Set 3 : Add missing comment in tcpport.cc (that's present in turnport.cc) #

Patch Set 4 : Add back Port constructor that takes IP for backwards compatibility. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+462 lines, -280 lines) Patch
M webrtc/p2p/base/fakeportallocator.h View 4 chunks +6 lines, -9 lines 0 comments Download
M webrtc/p2p/base/port.h View 1 2 3 3 chunks +8 lines, -3 lines 0 comments Download
M webrtc/p2p/base/port.cc View 5 chunks +5 lines, -8 lines 0 comments Download
M webrtc/p2p/base/port_unittest.cc View 18 chunks +47 lines, -34 lines 0 comments Download
M webrtc/p2p/base/relayport.h View 2 chunks +2 lines, -4 lines 0 comments Download
M webrtc/p2p/base/relayport.cc View 3 chunks +3 lines, -5 lines 0 comments Download
M webrtc/p2p/base/relayport_unittest.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M webrtc/p2p/base/stunport.h View 6 chunks +3 lines, -10 lines 0 comments Download
M webrtc/p2p/base/stunport.cc View 5 chunks +3 lines, -6 lines 0 comments Download
M webrtc/p2p/base/stunport_unittest.cc View 3 chunks +7 lines, -5 lines 0 comments Download
M webrtc/p2p/base/tcpport.h View 2 chunks +2 lines, -4 lines 0 comments Download
M webrtc/p2p/base/tcpport.cc View 1 2 7 chunks +62 lines, -38 lines 0 comments Download
M webrtc/p2p/base/tcpport_unittest.cc View 1 2 chunks +102 lines, -28 lines 0 comments Download
M webrtc/p2p/base/turnport.h View 4 chunks +6 lines, -5 lines 0 comments Download
M webrtc/p2p/base/turnport.cc View 1 2 9 chunks +38 lines, -29 lines 0 comments Download
M webrtc/p2p/base/turnport_unittest.cc View 10 chunks +107 lines, -39 lines 0 comments Download
M webrtc/p2p/client/basicportallocator.h View 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/p2p/client/basicportallocator.cc View 10 chunks +28 lines, -37 lines 0 comments Download
M webrtc/rtc_base/virtualsocketserver.h View 4 chunks +11 lines, -6 lines 0 comments Download
M webrtc/rtc_base/virtualsocketserver.cc View 4 chunks +16 lines, -6 lines 0 comments Download

Messages

Total messages: 13 (8 generated)
Taylor Brandstetter
PTAL Zhi. This fixes an issue where we may discard an ICE candidate on Android ...
3 years, 4 months ago (2017-08-02 22:24:31 UTC) #5
Zhi Huang
lgtm with a minor comment. https://codereview.webrtc.org/2989303002/diff/20001/webrtc/p2p/base/tcpport.cc File webrtc/p2p/base/tcpport.cc (right): https://codereview.webrtc.org/2989303002/diff/20001/webrtc/p2p/base/tcpport.cc#newcode405 webrtc/p2p/base/tcpport.cc:405: // Maybe add some ...
3 years, 4 months ago (2017-08-03 04:07:11 UTC) #6
Taylor Brandstetter
https://codereview.webrtc.org/2989303002/diff/20001/webrtc/p2p/base/tcpport.cc File webrtc/p2p/base/tcpport.cc (right): https://codereview.webrtc.org/2989303002/diff/20001/webrtc/p2p/base/tcpport.cc#newcode405 webrtc/p2p/base/tcpport.cc:405: // On 2017/08/03 04:07:11, Zhi Huang wrote: > Maybe ...
3 years, 4 months ago (2017-08-03 16:11:03 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2989303002/60001
3 years, 4 months ago (2017-08-04 21:16:37 UTC) #10
commit-bot: I haz the power
3 years, 4 months ago (2017-08-04 22:02:05 UTC) #13
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/external/webrtc/+/5c3c104ba0f843b9c46a921c8...

Powered by Google App Engine
This is Rietveld 408576698