Commit ac0b52ee authored by szym@chromium.org's avatar szym@chromium.org

[net/dns] Test IPv6 support via UDP connect

After this CL, the effective address family will be determined by
the UDP connect test rather than the last interface enumeration probe.

BUG=223876

Review URL: https://codereview.chromium.org/14161008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195406 0039d316-1c4b-4281-b951-d872f2087c98
parent effad416
...@@ -2054,32 +2054,33 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest( ...@@ -2054,32 +2054,33 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest(
AddressFamily effective_address_family = info.address_family(); AddressFamily effective_address_family = info.address_family();
if (info.address_family() == ADDRESS_FAMILY_UNSPECIFIED) { if (info.address_family() == ADDRESS_FAMILY_UNSPECIFIED) {
base::TimeTicks start_time = base::TimeTicks::Now(); if (ipv6_probe_monitoring_) {
// Google DNS address. base::TimeTicks start_time = base::TimeTicks::Now();
const uint8 kIPv6Address[] = // Google DNS address.
{ 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, const uint8 kIPv6Address[] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 }; { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
bool rv6 = IsGloballyReachable( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
IPAddressNumber(kIPv6Address, kIPv6Address + arraysize(kIPv6Address))); IPAddressNumber address(kIPv6Address,
kIPv6Address + arraysize(kIPv6Address));
UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration", bool rv6 = IsGloballyReachable(address);
base::TimeTicks::Now() - start_time);
if (rv6) { UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration",
UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectSuccessMatch", base::TimeTicks::Now() - start_time);
default_address_family_ == ADDRESS_FAMILY_UNSPECIFIED); if (rv6) {
UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectSuccessMatch",
default_address_family_ == ADDRESS_FAMILY_UNSPECIFIED);
} else {
UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch",
default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED);
effective_address_family = ADDRESS_FAMILY_IPV4;
effective_flags |= HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
}
} else { } else {
UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch", effective_address_family = default_address_family_;
default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED);
} }
} }
if (effective_address_family == ADDRESS_FAMILY_UNSPECIFIED &&
default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED) {
effective_address_family = default_address_family_;
if (ipv6_probe_monitoring_)
effective_flags |= HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
}
return Key(info.hostname(), effective_address_family, effective_flags); return Key(info.hostname(), effective_address_family, effective_flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment