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

Issue 2646863005: Fixing logic for using android_setsocknetwork() with bind(). (Closed)

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

Description

Fixing 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -30 lines) Patch
M webrtc/base/networkmonitor.h View 1 2 2 chunks +9 lines, -8 lines 0 comments Download
M webrtc/base/physicalsocketserver.cc View 1 2 3 4 5 6 2 chunks +35 lines, -9 lines 0 comments Download
M webrtc/base/physicalsocketserver_unittest.cc View 1 2 3 4 5 6 7 3 chunks +39 lines, -0 lines 0 comments Download
M webrtc/base/socketserver.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M webrtc/sdk/android/src/jni/androidnetworkmonitor_jni.cc View 1 2 3 4 5 7 chunks +12 lines, -11 lines 0 comments Download

Messages

Total messages: 32 (17 generated)
pthatcher1
Any way we can add a unit test? https://codereview.webrtc.org/2646863005/diff/60001/webrtc/base/physicalsocketserver.cc File webrtc/base/physicalsocketserver.cc (right): https://codereview.webrtc.org/2646863005/diff/60001/webrtc/base/physicalsocketserver.cc#newcode215 webrtc/base/physicalsocketserver.cc:215: return ...
3 years, 10 months ago (2017-02-10 18:12:19 UTC) #5
Taylor Brandstetter
A test would require configuring a physical device with specific network interfaces and routes; I'm ...
3 years, 10 months ago (2017-02-10 18:57:52 UTC) #6
pthatcher1
Could you pass in a FakeNetworkBinder and test some behavior based on what result you ...
3 years, 10 months ago (2017-02-10 22:01:00 UTC) #7
Taylor Brandstetter
On 2017/02/10 22:01:00, pthatcher1 wrote: > Could you pass in a FakeNetworkBinder and test some ...
3 years, 10 months ago (2017-02-10 22:29:52 UTC) #8
pthatcher1
lgtm
3 years, 10 months ago (2017-02-10 22:41:46 UTC) #9
Taylor Brandstetter
magjed@: PTAL at JNI code
3 years, 10 months ago (2017-02-10 22:48:03 UTC) #11
magjed_webrtc
jni code lgtm
3 years, 10 months ago (2017-02-13 16:01:49 UTC) #12
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/2646863005/80001
3 years, 10 months ago (2017-02-13 17:27:06 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: linux_asan on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_asan/builds/21992) win_rel on master.tryserver.webrtc (JOB_FAILED, ...
3 years, 10 months ago (2017-02-13 17:41:04 UTC) #16
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/2646863005/100001
3 years, 10 months ago (2017-02-13 18:46:16 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_rel on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_arm64_rel/builds/15462)
3 years, 10 months ago (2017-02-13 19:13:57 UTC) #21
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/2646863005/120001
3 years, 10 months ago (2017-02-13 21:44:18 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: linux_asan on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_asan/builds/22000) linux_ubsan_vptr on master.tryserver.webrtc (JOB_FAILED, ...
3 years, 10 months ago (2017-02-13 21:56:48 UTC) #26
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/2646863005/140001
3 years, 10 months ago (2017-02-13 22:33:24 UTC) #29
commit-bot: I haz the power
3 years, 10 months ago (2017-02-13 23:42:04 UTC) #32
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/external/webrtc/+/c874d1296a96bd234c17fb73c...

Powered by Google App Engine
This is Rietveld 408576698