Add-flag-to-disable-IPv6-probes.patch 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Sun, 18 Nov 2018 13:06:49 +0100
  3. Subject: Add flag to disable IPv6 probes
  4. ---
  5. chrome/browser/about_flags.cc | 5 +++++
  6. chrome/browser/flag_descriptions.cc | 4 ++++
  7. chrome/browser/flag_descriptions.h | 3 +++
  8. net/dns/host_resolver_manager.cc | 10 ++++++++--
  9. services/network/public/cpp/features.cc | 4 ++++
  10. services/network/public/cpp/features.h | 2 ++
  11. 6 files changed, 26 insertions(+), 2 deletions(-)
  12. diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  13. --- a/chrome/browser/about_flags.cc
  14. +++ b/chrome/browser/about_flags.cc
  15. @@ -2867,6 +2867,11 @@ const FeatureEntry kFeatureEntries[] = {
  16. kMarkHttpAsFeatureVariations,
  17. "HTTPReallyBadFinal")},
  18. + {"ipv6-probing",
  19. + flag_descriptions::kIPv6ProbingName,
  20. + flag_descriptions::kIPv6ProbingDescription, kOsAll,
  21. + FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
  22. +
  23. #if !defined(OS_ANDROID)
  24. {"enable-web-authentication-testing-api",
  25. flag_descriptions::kEnableWebAuthenticationTestingAPIName,
  26. diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
  27. --- a/chrome/browser/flag_descriptions.cc
  28. +++ b/chrome/browser/flag_descriptions.cc
  29. @@ -2265,6 +2265,10 @@ const char kForegroundNotificationManagerDescription[] =
  30. const char kHomePageButtonName[] = "Force Enable Home Page Button";
  31. const char kHomePageButtonDescription[] = "Displays a home button if enabled.";
  32. +const char kIPv6ProbingName[] = "Enable IPv6 probing.";
  33. +const char kIPv6ProbingDescription[] =
  34. + "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
  35. +
  36. const char kHomepageTileName[] =
  37. "Enable Homepage tile shown in Suggested Tiles";
  38. const char kHomepageTileDescription[] =
  39. diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
  40. --- a/chrome/browser/flag_descriptions.h
  41. +++ b/chrome/browser/flag_descriptions.h
  42. @@ -483,6 +483,9 @@ extern const char kEnableNewDownloadBackendDescription[];
  43. extern const char kEnablePortalsName[];
  44. extern const char kEnablePortalsDescription[];
  45. +extern const char kIPv6ProbingName[];
  46. +extern const char kIPv6ProbingDescription[];
  47. +
  48. extern const char kEnablePictureInPictureName[];
  49. extern const char kEnablePictureInPictureDescription[];
  50. diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
  51. --- a/net/dns/host_resolver_manager.cc
  52. +++ b/net/dns/host_resolver_manager.cc
  53. @@ -87,6 +87,7 @@
  54. #include "net/socket/client_socket_factory.h"
  55. #include "net/socket/datagram_client_socket.h"
  56. #include "net/url_request/url_request_context.h"
  57. +#include "services/network/public/cpp/features.h"
  58. #include "url/url_canon_ip.h"
  59. #if BUILDFLAG(ENABLE_MDNS)
  60. @@ -2952,8 +2953,13 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
  61. bool cached = true;
  62. if ((tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
  63. kIPv6ProbePeriodMs) {
  64. - last_ipv6_probe_result_ =
  65. - IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
  66. + if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
  67. + // pretend IPv6 connectivy probe is successful when probing is disabled
  68. + last_ipv6_probe_result_ = true;
  69. + } else {
  70. + last_ipv6_probe_result_ =
  71. + IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
  72. + }
  73. last_ipv6_probe_time_ = tick_clock_->NowTicks();
  74. cached = false;
  75. }
  76. diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
  77. --- a/services/network/public/cpp/features.cc
  78. +++ b/services/network/public/cpp/features.cc
  79. @@ -44,6 +44,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
  80. const base::Feature kThrottleDelayable{"ThrottleDelayable",
  81. base::FEATURE_ENABLED_BY_DEFAULT};
  82. +// Enable IPv6 ping probes to RIPE DNS.
  83. +const base::Feature kIPv6Probing{"IPv6Probing",
  84. + base::FEATURE_DISABLED_BY_DEFAULT};
  85. +
  86. // When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
  87. // requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
  88. // ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
  89. diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
  90. --- a/services/network/public/cpp/features.h
  91. +++ b/services/network/public/cpp/features.h
  92. @@ -18,6 +18,8 @@ extern const base::Feature kNetworkErrorLogging;
  93. COMPONENT_EXPORT(NETWORK_CPP)
  94. extern const base::Feature kNetworkService;
  95. COMPONENT_EXPORT(NETWORK_CPP)
  96. +extern const base::Feature kIPv6Probing;
  97. +COMPONENT_EXPORT(NETWORK_CPP)
  98. extern const base::Feature kOutOfBlinkCors;
  99. COMPONENT_EXPORT(NETWORK_CPP)
  100. extern const base::Feature kReporting;
  101. --
  102. 2.11.0