Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: net/dns/host_resolver_impl.cc

Issue 1088513004: Don't probe for IPv6 connectivity when resolving IPv6 literals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698