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,13 +2054,15 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest( ...@@ -2054,13 +2054,15 @@ 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) {
if (ipv6_probe_monitoring_) {
base::TimeTicks start_time = base::TimeTicks::Now(); base::TimeTicks start_time = base::TimeTicks::Now();
// Google DNS address. // Google DNS address.
const uint8 kIPv6Address[] = const uint8 kIPv6Address[] =
{ 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 }; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 };
bool rv6 = IsGloballyReachable( IPAddressNumber address(kIPv6Address,
IPAddressNumber(kIPv6Address, kIPv6Address + arraysize(kIPv6Address))); kIPv6Address + arraysize(kIPv6Address));
bool rv6 = IsGloballyReachable(address);
UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration", UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration",
base::TimeTicks::Now() - start_time); base::TimeTicks::Now() - start_time);
...@@ -2070,15 +2072,14 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest( ...@@ -2070,15 +2072,14 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest(
} else { } else {
UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch", UMA_HISTOGRAM_BOOLEAN("Net.IPv6ConnectFailureMatch",
default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED); default_address_family_ != ADDRESS_FAMILY_UNSPECIFIED);
}
}
if (effective_address_family == ADDRESS_FAMILY_UNSPECIFIED && effective_address_family = ADDRESS_FAMILY_IPV4;
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; effective_flags |= HOST_RESOLVER_DEFAULT_FAMILY_SET_DUE_TO_NO_IPV6;
} }
} else {
effective_address_family = default_address_family_;
}
}
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