Chromium Code Reviews| Index: net/dns/host_resolver_impl.cc |
| diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc |
| index e84a844a32f7c44a275944ea502a1bdebe4fc505..257715ebc691537caefdcc7cbc8da28aaf580f94 100644 |
| --- a/net/dns/host_resolver_impl.cc |
| +++ b/net/dns/host_resolver_impl.cc |
| @@ -2154,13 +2154,17 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest( |
| AddressFamily effective_address_family = info.address_family(); |
| if (info.address_family() == ADDRESS_FAMILY_UNSPECIFIED) { |
| - unsigned char ip_number[4]; |
| - url::Component host_comp(0, info.hostname().size()); |
| - int num_components; |
| + IPAddressNumber ip_number; |
| if (probe_ipv6_support_ && !use_local_ipv6_ && |
| - // Don't bother IPv6 probing when resolving IPv4 literals. |
| - url::IPv4AddressToNumber(info.hostname().c_str(), host_comp, ip_number, |
| - &num_components) != url::CanonHostInfo::IPV4) { |
| + // When resolving IPv4 literals, there's no need to probe for IPv6. |
| + // When resolving IPv6 literals, there's no benefit to artificially |
| + // limiting our resolution based on a probe. We've already |
| + // checked that this query is UNSPECIFIED (see info.address_family() |
| + // check above) and that default_address_family_ is UNSPECIFIED |
| + // (prove_ipv6_support_ is false if default_address_family_ is |
| + // set) so the code requesting the resolution should be amenable to |
| + // receiving a IPv6 resolution. |
| + !ParseIPLiteralToNumber(info.hostname(), &ip_number)) { |
|
mmenke
2015/04/13 16:43:51
Wonder if it'd be cleaner just to move ParseIPLite
pauljensen
2015/04/15 01:29:29
Done.
|
| // Google DNS address. |
| const uint8 kIPv6Address[] = |
| { 0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, |