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

Unified Diff: net/base/net_util_posix.cc

Issue 105653003: GetNetworkList() copies sa_family of ifa_addr to ifa_netmask if unset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase onto HEAD Created 7 years 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 5e1042b4304c6ba9ba8d17954c259edc2193f860..34f64ce162c9606341abdfb4ca107f23cb767002 100644
--- a/net/base/net_util_posix.cc
+++ b/net/base/net_util_posix.cc
@@ -143,6 +143,10 @@ bool GetNetworkList(NetworkInterfaceList* networks) {
if (address.FromSockAddr(addr, addr_size)) {
uint8 net_mask = 0;
if (interface->ifa_netmask) {
+ // If not otherwise set, assume the same sa_family as ifa_addr.
+ if (interface->ifa_netmask->sa_family == 0) {
+ interface->ifa_netmask->sa_family = addr->sa_family;
+ }
IPEndPoint netmask;
if (netmask.FromSockAddr(interface->ifa_netmask, addr_size)) {
net_mask = MaskPrefixLength(netmask.address());
« 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