add-ipv6-probing-option.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Disables IPv6 probing and adds an option to change the IPv6 probing result
  2. --- a/chrome/browser/ungoogled_flag_entries.h
  3. +++ b/chrome/browser/ungoogled_flag_entries.h
  4. @@ -4,4 +4,8 @@
  5. #ifndef CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
  6. #define CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
  7. + {"set-ipv6-probe-false",
  8. + "SetIpv6ProbeFalse",
  9. + "Forces the result of the browser's IPv6 probing (i.e. IPv6 connectivity test) to be unsuccessful. This causes IPv4 addresses to be prioritized over IPv6 addresses. Without this flag, the probing result is set to be successful, which causes IPv6 to be used over IPv4 when possible. ungoogled-chromium flag.",
  10. + kOsAll, FEATURE_VALUE_TYPE(net::features::kSetIpv6ProbeFalse)},
  11. #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
  12. --- a/net/base/features.cc
  13. +++ b/net/base/features.cc
  14. @@ -11,6 +11,8 @@
  15. namespace net::features {
  16. +BASE_FEATURE(kSetIpv6ProbeFalse, "SetIpv6ProbeFalse", base::FEATURE_DISABLED_BY_DEFAULT);
  17. +
  18. BASE_FEATURE(kAlpsForHttp2, "AlpsForHttp2", base::FEATURE_ENABLED_BY_DEFAULT);
  19. BASE_FEATURE(kAvoidH2Reprioritization,
  20. --- a/net/base/features.h
  21. +++ b/net/base/features.h
  22. @@ -18,6 +18,8 @@
  23. namespace net::features {
  24. +NET_EXPORT BASE_DECLARE_FEATURE(kSetIpv6ProbeFalse);
  25. +
  26. // Enables ALPS extension of TLS 1.3 for HTTP/2, see
  27. // https://vasilvv.github.io/tls-alps/draft-vvv-tls-alps.html and
  28. // https://vasilvv.github.io/httpbis-alps/draft-vvv-httpbis-alps.html.
  29. --- a/net/dns/host_resolver_manager.cc
  30. +++ b/net/dns/host_resolver_manager.cc
  31. @@ -155,11 +155,6 @@ const unsigned kMinimumTTLSeconds = kCac
  32. // cached.
  33. const int kIPv6ProbePeriodMs = 1000;
  34. -// RIPE NCC k.root-servers.net. 2001:7fd::1 (anycasted), used for IPv6 probes.
  35. -const uint8_t kIPv6ProbeAddress[] = {0x20, 0x01, 0x07, 0xfd, 0x00, 0x00,
  36. - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  37. - 0x00, 0x00, 0x00, 0x01};
  38. -
  39. // ICANN uses this localhost address to indicate a name collision.
  40. //
  41. // The policy in Chromium is to fail host resolving if it resolves to
  42. @@ -3760,7 +3755,7 @@ bool HostResolverManager::IsIPv6Reachabl
  43. (tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
  44. kIPv6ProbePeriodMs) {
  45. SetLastIPv6ProbeResult(
  46. - IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log));
  47. + !base::FeatureList::IsEnabled(features::kSetIpv6ProbeFalse));
  48. cached = false;
  49. }
  50. net_log.AddEvent(