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

Unified Diff: net/base/net_util_posix.cc

Issue 7552030: Fix GetNetworkList() for POSIX to cope with address-less interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util_posix.cc
diff --git a/net/base/net_util_posix.cc b/net/base/net_util_posix.cc
index 0412792ebb2e38efcf67e3ad76ad53463508eb3b..8b6bd64bcaa3308ba6328c6c0c35770dfe1589d3 100644
--- a/net/base/net_util_posix.cc
+++ b/net/base/net_util_posix.cc
@@ -76,6 +76,8 @@ bool GetNetworkList(NetworkInterfaceList* networks) {
for (ifaddrs *ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
int family = ifa->ifa_addr->sa_family;
+ if (!ifa->ifa_addr)
+ continue;
wtc 2011/08/10 19:29:02 Did you test this patch? On line 78 you have alre
wtc 2011/08/10 19:32:22 I checked the other two getifaddrs calls in net/ba
if (family == AF_INET || family == AF_INET6) {
IPEndPoint address;
std::string name = ifa->ifa_name;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698