summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-10 23:56:29 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-10 23:56:29 +0000
commita2730f03990ef98e5d0f6f118b6c3495e73dcb6f (patch)
treec276b152a31a68d813fc5ffcc5c2bbeef0c378c1 /net
parentd862b1f74beec781749d40549e8cbb6ccadc68ef (diff)
downloadchromium_src-a2730f03990ef98e5d0f6f118b6c3495e73dcb6f.zip
chromium_src-a2730f03990ef98e5d0f6f118b6c3495e73dcb6f.tar.gz
chromium_src-a2730f03990ef98e5d0f6f118b6c3495e73dcb6f.tar.bz2
Fix GetNetworkList() for POSIX to cope with address-less interfaces.
BUG=92274 TEST=Browser does not crash if Chromoting client is used to connect from a machine with at least one network interface with no IP address. Review URL: http://codereview.chromium.org/7552030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/net_util_posix.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc
index 0412792..9257989 100644
--- a/net/base/net_util_posix.cc
+++ b/net/base/net_util_posix.cc
@@ -75,6 +75,8 @@ bool GetNetworkList(NetworkInterfaceList* networks) {
}
for (ifaddrs *ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
+ if (!ifa->ifa_addr)
+ continue; // Interface has no IP addresses, so skip it.
int family = ifa->ifa_addr->sa_family;
if (family == AF_INET || family == AF_INET6) {
IPEndPoint address;