add-ipv6-probing-option.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Disables IPv6 probing and adds an option to change the IPv6 probing result
  2. # TODO: Consider adding a chrome://flag to set the command-line flag
  3. --- a/net/dns/host_resolver_manager.cc
  4. +++ b/net/dns/host_resolver_manager.cc
  5. @@ -30,6 +30,7 @@
  6. #include "base/bind_helpers.h"
  7. #include "base/callback.h"
  8. #include "base/callback_helpers.h"
  9. +#include "base/command_line.h"
  10. #include "base/compiler_specific.h"
  11. #include "base/containers/flat_set.h"
  12. #include "base/containers/linked_list.h"
  13. @@ -130,11 +131,6 @@ const unsigned kMinimumTTLSeconds = kCac
  14. // cached.
  15. const int kIPv6ProbePeriodMs = 1000;
  16. -// RIPE NCC k.root-servers.net. 2001:7fd::1 (anycasted), used for IPv6 probes.
  17. -const uint8_t kIPv6ProbeAddress[] = {0x20, 0x01, 0x07, 0xfd, 0x00, 0x00,
  18. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  19. - 0x00, 0x00, 0x00, 0x01};
  20. -
  21. enum DnsResolveStatus {
  22. RESOLVE_STATUS_DNS_SUCCESS = 0,
  23. RESOLVE_STATUS_PROC_SUCCESS,
  24. @@ -3565,7 +3561,7 @@ bool HostResolverManager::IsIPv6Reachabl
  25. (tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
  26. kIPv6ProbePeriodMs) {
  27. SetLastIPv6ProbeResult(
  28. - IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log));
  29. + !base::CommandLine::ForCurrentProcess()->HasSwitch("set-ipv6-probe-false"));
  30. cached = false;
  31. }
  32. net_log.AddEvent(