summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-21 15:26:07 +0000
committerszym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-21 15:26:07 +0000
commitd93bd4fa4addff93ceda51f7ee2b744b1fa0ddc0 (patch)
tree96c141ce8603b4f08faa9b8958df3a14f721e004
parenteeec6ca906162249c030778cbc42f77384cea642 (diff)
downloadchromium_src-d93bd4fa4addff93ceda51f7ee2b744b1fa0ddc0.zip
chromium_src-d93bd4fa4addff93ceda51f7ee2b744b1fa0ddc0.tar.gz
chromium_src-d93bd4fa4addff93ceda51f7ee2b744b1fa0ddc0.tar.bz2
[net] Ignore Teredo addresses when determining IPv6 support.
On systems with only Teredo IPv6 addresses, Windows resolver does not make queries for AAAA DNS records. Therefore, we can safely resort to AF_INET-only lookups instead of AF_UNSPEC. This will make no difference when using the system resolver (getaddrinfo), but should reduce penalty on AsyncDNS which currently performs A/AAAA queries in series. BUG=171549 Review URL: https://chromiumcodereview.appspot.com/12296028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183818 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/base/net_util.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index ce1f786..ffbbb7a 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1878,6 +1878,9 @@ IPv6SupportResult TestIPv6SupportInternal() {
struct in6_addr* sin6_addr = &addr_in6->sin6_addr;
if (IN6_IS_ADDR_LOOPBACK(sin6_addr) || IN6_IS_ADDR_LINKLOCAL(sin6_addr))
continue;
+ const uint8 kTeredoPrefix[] = { 0x20, 0x01, 0, 0 };
+ if (!memcmp(sin6_addr->s6_addr, kTeredoPrefix, arraysize(kTeredoPrefix)))
+ continue;
return IPv6SupportResult(true, IPV6_GLOBAL_ADDRESS_PRESENT, 0);
}
}