On iOS, detect pdp_ip networks as cellular.
BUG=
R=juberti@webrtc.org, tkchin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/44009004
Cr-Commit-Position: refs/heads/master@{#8943}
diff --git a/webrtc/base/network.cc b/webrtc/base/network.cc
index ff09236..2081c94 100644
--- a/webrtc/base/network.cc
+++ b/webrtc/base/network.cc
@@ -381,9 +381,15 @@
if (existing_network == current_networks.end()) {
AdapterType adapter_type = ADAPTER_TYPE_UNKNOWN;
if (cursor->ifa_flags & IFF_LOOPBACK) {
- // TODO(phoglund): Need to recognize other types as well.
adapter_type = ADAPTER_TYPE_LOOPBACK;
}
+#if defined(WEBRTC_IOS)
+ // Cell networks are pdp_ipN on iOS.
+ if (strncmp(cursor->ifa_name, "pdp_ip", 6) == 0) {
+ adapter_type = ADAPTER_TYPE_CELLULAR;
+ }
+#endif
+ // TODO(phoglund): Need to recognize other types as well.
scoped_ptr<Network> network(new Network(cursor->ifa_name,
cursor->ifa_name,
prefix,