summaryrefslogtreecommitdiffstats
path: root/net/base/net_util_posix.cc
diff options
context:
space:
mode:
authordubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 17:26:19 +0000
committerdubroy@chromium.org <dubroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 17:26:19 +0000
commit649dd8126f846d18fb434435ce18478144e7bc1c (patch)
tree0a7661543ce61a9c05d3855052778bcbe4639630 /net/base/net_util_posix.cc
parenta723e995ee0fa2962d77377b3e4b267f02a962d4 (diff)
downloadchromium_src-649dd8126f846d18fb434435ce18478144e7bc1c.zip
chromium_src-649dd8126f846d18fb434435ce18478144e7bc1c.tar.gz
chromium_src-649dd8126f846d18fb434435ce18478144e7bc1c.tar.bz2
Reland 238671 "Added net::NetworkInterface::interface_index."
net_unittests still failed after reverting the original CL, so it obviously wasn't the cause of the failures. > Revert 238671 "Added net::NetworkInterface::interface_index." > > Speculative revert to see if it fixes the issues with net_unittests > on WinXP: http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%282%29/builds/32133/steps/net_unittests/logs/stdio > > > Added net::NetworkInterface::interface_index. > > Not implemented for Android. > > > > BUG=319068 > > > > Review URL: https://codereview.chromium.org/100703002 > > TBR=vitalybuka@chromium.org > > Review URL: https://codereview.chromium.org/101403004 TBR=dubroy@chromium.org Review URL: https://codereview.chromium.org/105053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238715 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util_posix.cc')
-rw-r--r--net/base/net_util_posix.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc
index 4ff3ee9..5e1042b 100644
--- a/net/base/net_util_posix.cc
+++ b/net/base/net_util_posix.cc
@@ -81,8 +81,12 @@ bool GetNetworkList(NetworkInterfaceList* networks) {
&address,
&network_prefix));
+ CHECK(network_tokenizer.GetNext());
+ uint32 index = 0;
+ CHECK(base::StringToUint(network_tokenizer.token(), &index));
+
networks->push_back(
- NetworkInterface(name, address, network_prefix));
+ NetworkInterface(name, index, address, network_prefix));
}
return true;
#else
@@ -108,6 +112,7 @@ bool GetNetworkList(NetworkInterfaceList* networks) {
struct sockaddr* addr = interface->ifa_addr;
if (!addr)
continue;
+
// Skip unspecified addresses (i.e. made of zeroes) and loopback addresses
// configured on non-loopback interfaces.
int addr_size = 0;
@@ -144,7 +149,9 @@ bool GetNetworkList(NetworkInterfaceList* networks) {
}
}
- networks->push_back(NetworkInterface(name, address.address(), net_mask));
+ networks->push_back(
+ NetworkInterface(name, if_nametoindex(name.c_str()),
+ address.address(), net_mask));
}
}