diff options
author | szym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-28 23:57:14 +0000 |
---|---|---|
committer | szym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-28 23:57:14 +0000 |
commit | 31708f932d88f008321a9256b379fea401aa228f (patch) | |
tree | fd4853c1d651147321e43eca007d7c54522797aa /net/dns | |
parent | 497d8a9857e7383f979b89694aff8dd403c176fe (diff) | |
download | chromium_src-31708f932d88f008321a9256b379fea401aa228f.zip chromium_src-31708f932d88f008321a9256b379fea401aa228f.tar.gz chromium_src-31708f932d88f008321a9256b379fea401aa228f.tar.bz2 |
[net/dns] Mute warnings from AddressSorterPosix on MacOS.
It's not unusual for network interfaces on Mac to have non-inet
addresses. We should ignore them without warning.
BUG=156007
Review URL: https://chromiumcodereview.appspot.com/12077003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/dns')
-rw-r--r-- | net/dns/address_sorter_posix.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/dns/address_sorter_posix.cc b/net/dns/address_sorter_posix.cc index 51ef35e..8d87774 100644 --- a/net/dns/address_sorter_posix.cc +++ b/net/dns/address_sorter_posix.cc @@ -377,10 +377,8 @@ void AddressSorterPosix::OnIPAddressChanged() { for (struct ifaddrs* ifa = addrs; ifa != NULL; ifa = ifa->ifa_next) { IPEndPoint src; - if (!src.FromSockAddr(ifa->ifa_addr, ifa->ifa_addr->sa_len)) { - LOG(WARNING) << "FromSockAddr failed"; + if (!src.FromSockAddr(ifa->ifa_addr, ifa->ifa_addr->sa_len)) continue; - } SourceAddressInfo& info = source_map_[src.address()]; // Note: no known way to fill in |native| and |home|. info.native = info.home = info.deprecated = false; @@ -390,7 +388,7 @@ void AddressSorterPosix::OnIPAddressChanged() { DCHECK_LE(ifa->ifa_addr->sa_len, sizeof(ifr.ifr_ifru.ifru_addr)); memcpy(&ifr.ifr_ifru.ifru_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len); int rv = ioctl(ioctl_socket, SIOCGIFAFLAG_IN6, &ifr); - if (rv > 0) { + if (rv >= 0) { info.deprecated = ifr.ifr_ifru.ifru_flags & IN6_IFF_DEPRECATED; } else { LOG(WARNING) << "SIOCGIFAFLAG_IN6 failed " << rv; |