DescriptionFixing logic for using android_setsocknetwork() with bind().
If android_setsocknetwork() is available, and it fails, then bind()
should *not* be called, and an error should be returned.
If it succeeds, then bind should be called, but with an "any" address.
This is to prevent cases where sockets are sent with a source address
that doesn't match the network interface they're sent on. See bug below.
This CL also changes "NetworkBinderResults" to an enum class, and
renames it to "NetworkBinderResult".
BUG=webrtc:7026
Review-Url: https://codereview.webrtc.org/2646863005
Cr-Commit-Position: refs/heads/master@{#16597}
Committed: https://chromium.googlesource.com/external/webrtc/+/c874d1296a96bd234c17fb73c0327d69b7f7c5dd
Patch Set 1 #Patch Set 2 : Call bind, but just with ANY address. Also, add comments. #Patch Set 3 : Handling network binder return codes properly, and changing to enum class #Patch Set 4 : comment formatting #
Total comments: 2
Patch Set 5 : Adding test using fake network binder. #Patch Set 6 : Only use fake network binder in test that intends to use it. #Patch Set 7 : Don't treat failing to bind to loopback interface as an error. #Patch Set 8 : Fixing tests for loopback IP change. #
Messages
Total messages: 32 (17 generated)
|