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}
This commit is contained in:
@@ -381,9 +381,15 @@ void BasicNetworkManager::ConvertIfAddrs(struct ifaddrs* interfaces,
|
|||||||
if (existing_network == current_networks.end()) {
|
if (existing_network == current_networks.end()) {
|
||||||
AdapterType adapter_type = ADAPTER_TYPE_UNKNOWN;
|
AdapterType adapter_type = ADAPTER_TYPE_UNKNOWN;
|
||||||
if (cursor->ifa_flags & IFF_LOOPBACK) {
|
if (cursor->ifa_flags & IFF_LOOPBACK) {
|
||||||
// TODO(phoglund): Need to recognize other types as well.
|
|
||||||
adapter_type = ADAPTER_TYPE_LOOPBACK;
|
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,
|
scoped_ptr<Network> network(new Network(cursor->ifa_name,
|
||||||
cursor->ifa_name,
|
cursor->ifa_name,
|
||||||
prefix,
|
prefix,
|
||||||
|
|||||||
Reference in New Issue
Block a user