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

Issue 302010: Add a mechanism to disable IPv6.... (Closed)

Created:
11 years, 2 months ago by eroman
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, darin (slow to review), ben+cc_chromium.org, tim (not reviewing), Paweł Hajdan Jr.
Visibility:
Public.

Description

Add a mechanism to disable IPv6. (1) Adds the ability to specify the address family on a per-request basis. (2) Exposes a --disable-ipv6 flag to chrome that changes the default address family from AF_UNSPEC to AF_INET (same sort of thing Firefox does). (3) Changes the backing datastructure for HostCache:EntryMap and HostResolverImpl::JobMap from a "hash_map" to a "std::map". This was for consistency with other code (when I went to add a custom hash trait, I couldn't find any existing code which was using hashmap for custom keys). (4) Updates about:net-internals to display an address family for the hostcache dump (since it is now a part of the key). This change is in anticipation of turning off IPv6 host resolving in the PAC utility functions (see bug 24641). But it is also a feature addition. BUG=24641 TEST=HostCacheTest.AddressFamilyIsPartOfKey Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=29686

Patch Set 1 #

Total comments: 11

Patch Set 2 : Address darin's comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -129 lines) Patch
M chrome/browser/net/dns_global.cc View 1 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/unit/chrome_test_suite.h View 2 chunks +4 lines, -2 lines 0 comments Download
A net/base/address_family.h View 1 chunk +19 lines, -0 lines 0 comments Download
M net/base/address_list_unittest.cc View 1 chunk +3 lines, -1 line 0 comments Download
M net/base/host_cache.h View 1 2 chunks +26 lines, -6 lines 0 comments Download
M net/base/host_cache.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M net/base/host_cache_unittest.cc View 1 10 chunks +108 lines, -67 lines 0 comments Download
M net/base/host_resolver.h View 1 5 chunks +13 lines, -0 lines 0 comments Download
M net/base/host_resolver_impl.h View 1 4 chunks +14 lines, -4 lines 2 comments Download
M net/base/host_resolver_impl.cc View 11 chunks +36 lines, -23 lines 0 comments Download
M net/base/host_resolver_impl_unittest.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M net/base/host_resolver_proc.h View 3 chunks +13 lines, -6 lines 0 comments Download
M net/base/host_resolver_proc.cc View 3 chunks +14 lines, -4 lines 0 comments Download
M net/base/mock_host_resolver.h View 2 chunks +7 lines, -3 lines 0 comments Download
M net/base/mock_host_resolver.cc View 3 chunks +5 lines, -2 lines 0 comments Download
M net/net.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M net/url_request/url_request_view_net_internals_job.cc View 3 chunks +21 lines, -5 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
eroman
11 years, 2 months ago (2009-10-19 23:29:00 UTC) #1
eroman
[cc-ing Wan-Teh]
11 years, 2 months ago (2009-10-19 23:29:43 UTC) #2
wtc
Eric: This CL seems larger than necessary. I believe we only need to add an ...
11 years, 2 months ago (2009-10-20 02:39:01 UTC) #3
eroman
> This CL seems larger than necessary. What parts of this change are unnecessary? While ...
11 years, 2 months ago (2009-10-20 03:23:52 UTC) #4
eroman
http://codereview.chromium.org/302010/diff/1/19 File chrome/common/chrome_switches.cc (right): http://codereview.chromium.org/302010/diff/1/19#newcode241 Line 241: const char kDisableIPv6[] = "disable-ipv6"; On 2009/10/20 02:39:01, ...
11 years, 2 months ago (2009-10-20 03:29:31 UTC) #5
darin (slow to review)
Maybe we should be supporting IE's IPv6 extensions for PAC? http://blogs.msdn.com/wndp/articles/IPV6_PAC_Extensions_v0_9.aspx On Mon, Oct 19, ...
11 years, 2 months ago (2009-10-20 06:06:12 UTC) #6
eroman
On Mon, Oct 19, 2009 at 11:05 PM, Darin Fisher <darin@chromium.org> wrote: > Maybe we ...
11 years, 2 months ago (2009-10-20 16:07:30 UTC) #7
darin (slow to review)
http://codereview.chromium.org/302010/diff/1/17 File chrome/browser/net/dns_global.cc (right): http://codereview.chromium.org/302010/diff/1/17#newcode485 Line 485: DisableIPv6(true); perhaps net::HostResolver should just expose a DisableIPv6 ...
11 years, 2 months ago (2009-10-20 20:49:54 UTC) #8
eroman
http://codereview.chromium.org/302010/diff/1/17 File chrome/browser/net/dns_global.cc (right): http://codereview.chromium.org/302010/diff/1/17#newcode485 Line 485: DisableIPv6(true); On 2009/10/20 20:49:54, darin wrote: > perhaps ...
11 years, 2 months ago (2009-10-20 21:04:28 UTC) #9
wtc
On 2009/10/20 02:39:01, wtc wrote: > > This CL seems larger than necessary. Eric, I ...
11 years, 2 months ago (2009-10-21 03:26:49 UTC) #10
darin (slow to review)
http://codereview.chromium.org/302010/diff/1/17 File chrome/browser/net/dns_global.cc (right): http://codereview.chromium.org/302010/diff/1/17#newcode485 Line 485: DisableIPv6(true); On 2009/10/20 21:04:28, eroman wrote: > On ...
11 years, 2 months ago (2009-10-21 06:25:01 UTC) #11
darin (slow to review)
LGTM
11 years, 2 months ago (2009-10-21 06:26:13 UTC) #12
Lorenzo Colitti
How is this a feature addition? Darin and I implemented disabling IPv6 on Firefox in ...
11 years, 2 months ago (2009-10-21 19:44:08 UTC) #13
eroman
Having the flag is useful for debugging, and workarounds. There have been bugs filed in ...
11 years, 2 months ago (2009-10-21 20:00:48 UTC) #14
Lorenzo Colitti
The harm is that code needs to be added to the browser (this patch touches ...
11 years, 2 months ago (2009-10-21 20:23:04 UTC) #15
eroman
I disagree. IMO the correct way to fix http://crbug.com/24641 is exactly to do IPv4-only host ...
11 years, 2 months ago (2009-10-21 20:32:35 UTC) #16
Lorenzo Colitti
Absolutely! You need to be able to support IPv4-only on a per DNS resolution request ...
11 years, 2 months ago (2009-10-21 20:42:18 UTC) #17
Lorenzo Colitti
http://codereview.chromium.org/302010/diff/2013/3021 File net/base/host_resolver_impl.h (right): http://codereview.chromium.org/302010/diff/2013/3021#newcode143 Line 143: bool disable_ipv6_; Instead, why not make this be ...
11 years, 2 months ago (2009-10-21 23:14:08 UTC) #18
eroman
11 years, 2 months ago (2009-10-21 23:32:07 UTC) #19
http://codereview.chromium.org/302010/diff/2013/3021
File net/base/host_resolver_impl.h (right):

http://codereview.chromium.org/302010/diff/2013/3021#newcode143
Line 143: bool disable_ipv6_;
On 2009/10/21 23:14:08, l.colitti wrote:
> Instead, why not make this be "int desired_address_family" It could default to
> AF_UNSPEC and then you could disable IPv6 by setting it to AF_INET.
> 
> The advantage is that you can pass this value directly into getaddrinfo(),
thus
> simplifying the code. Also, it's more flexible, since it allows the caller to
> disable IPv6, disable IPv4, or request any address family he wants.

Done.

See proposed change here: http://codereview.chromium.org/303026

(as this codereview was already committed).

Powered by Google App Engine
This is Rietveld 408576698