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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. components/subresource_filter/tools/BUILD.gn | 6 ++++++
  9. components/url_formatter/spoof_checks/top_domains/BUILD.gn | 3 ++-
  10. net/dns/host_resolver_manager.cc | 10 ++++++++--
  11. services/network/public/cpp/features.cc | 4 ++++
  12. services/network/public/cpp/features.h | 2 ++
  13. 8 files changed, 34 insertions(+), 3 deletions(-)
  14. diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  15. --- a/chrome/browser/about_flags.cc
  16. +++ b/chrome/browser/about_flags.cc
  17. @@ -3193,6 +3193,11 @@ const FeatureEntry kFeatureEntries[] = {
  18. kMarkHttpAsFeatureVariations,
  19. "HTTPReallyBadFinal")},
  20. + {"ipv6-probing",
  21. + flag_descriptions::kIPv6ProbingName,
  22. + flag_descriptions::kIPv6ProbingDescription, kOsAll,
  23. + FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
  24. +
  25. #if !defined(OS_ANDROID)
  26. {"enable-web-authentication-testing-api",
  27. flag_descriptions::kEnableWebAuthenticationTestingAPIName,
  28. diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
  29. --- a/chrome/browser/flag_descriptions.cc
  30. +++ b/chrome/browser/flag_descriptions.cc
  31. @@ -2512,6 +2512,10 @@ const char kForegroundNotificationManagerDescription[] =
  32. const char kHomePageButtonName[] = "Force Enable Home Page Button";
  33. const char kHomePageButtonDescription[] = "Displays a home button if enabled.";
  34. +const char kIPv6ProbingName[] = "Enable IPv6 probing.";
  35. +const char kIPv6ProbingDescription[] =
  36. + "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
  37. +
  38. const char kHomepageTileName[] =
  39. "Enable Homepage tile shown in Suggested Tiles";
  40. const char kHomepageTileDescription[] =
  41. diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
  42. --- a/chrome/browser/flag_descriptions.h
  43. +++ b/chrome/browser/flag_descriptions.h
  44. @@ -523,6 +523,9 @@ extern const char kEnableNewDownloadBackendDescription[];
  45. extern const char kEnablePortalsName[];
  46. extern const char kEnablePortalsDescription[];
  47. +extern const char kIPv6ProbingName[];
  48. +extern const char kIPv6ProbingDescription[];
  49. +
  50. extern const char kEnablePictureInPictureName[];
  51. extern const char kEnablePictureInPictureDescription[];
  52. diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn
  53. --- a/components/subresource_filter/tools/BUILD.gn
  54. +++ b/components/subresource_filter/tools/BUILD.gn
  55. @@ -52,6 +52,8 @@ if (!is_ios) {
  56. deps = [
  57. ":tools_lib",
  58. "//base",
  59. + "//components/network_session_configurator/common",
  60. + "//services/network/public/cpp"
  61. ]
  62. }
  63. @@ -65,6 +67,8 @@ if (!is_ios) {
  64. ":tools_lib",
  65. "../core/common",
  66. "//base",
  67. + "//components/network_session_configurator/common",
  68. + "//services/network/public/cpp",
  69. ]
  70. }
  71. @@ -76,6 +80,8 @@ if (!is_ios) {
  72. "ruleset_converter:support",
  73. "//base",
  74. "//third_party/protobuf:protobuf_lite",
  75. + "//components/network_session_configurator/common",
  76. + "//services/network/public/cpp"
  77. ]
  78. }
  79. diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
  80. --- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
  81. +++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
  82. @@ -78,7 +78,8 @@ executable("make_top_domain_list_for_edit_distance") {
  83. "//base",
  84. "//base:i18n",
  85. "//third_party/icu",
  86. - "//components/network_session_configurator/common"
  87. + "//components/network_session_configurator/common",
  88. + "//services/network/public/cpp",
  89. ]
  90. if (is_ios) {
  91. libs = [ "UIKit.framework" ]
  92. diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
  93. --- a/net/dns/host_resolver_manager.cc
  94. +++ b/net/dns/host_resolver_manager.cc
  95. @@ -87,6 +87,7 @@
  96. #include "net/socket/client_socket_factory.h"
  97. #include "net/socket/datagram_client_socket.h"
  98. #include "net/url_request/url_request_context.h"
  99. +#include "services/network/public/cpp/features.h"
  100. #include "url/url_canon_ip.h"
  101. #if BUILDFLAG(ENABLE_MDNS)
  102. @@ -3209,8 +3210,13 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
  103. bool cached = true;
  104. if ((tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
  105. kIPv6ProbePeriodMs) {
  106. - last_ipv6_probe_result_ =
  107. - IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
  108. + if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
  109. + // pretend IPv6 connectivy probe is successful when probing is disabled
  110. + last_ipv6_probe_result_ = true;
  111. + } else {
  112. + last_ipv6_probe_result_ =
  113. + IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log);
  114. + }
  115. last_ipv6_probe_time_ = tick_clock_->NowTicks();
  116. cached = false;
  117. }
  118. diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
  119. --- a/services/network/public/cpp/features.cc
  120. +++ b/services/network/public/cpp/features.cc
  121. @@ -46,6 +46,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
  122. const base::Feature kThrottleDelayable{"ThrottleDelayable",
  123. base::FEATURE_ENABLED_BY_DEFAULT};
  124. +// Enable IPv6 ping probes to RIPE DNS.
  125. +const base::Feature kIPv6Probing{"IPv6Probing",
  126. + base::FEATURE_ENABLED_BY_DEFAULT};
  127. +
  128. // When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
  129. // requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
  130. // ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
  131. diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
  132. --- a/services/network/public/cpp/features.h
  133. +++ b/services/network/public/cpp/features.h
  134. @@ -19,6 +19,8 @@ extern const base::Feature kNetworkErrorLogging;
  135. COMPONENT_EXPORT(NETWORK_CPP)
  136. extern const base::Feature kNetworkService;
  137. COMPONENT_EXPORT(NETWORK_CPP)
  138. +extern const base::Feature kIPv6Probing;
  139. +COMPONENT_EXPORT(NETWORK_CPP)
  140. extern const base::Feature kOutOfBlinkCors;
  141. COMPONENT_EXPORT(NETWORK_CPP)
  142. extern const base::Feature kReporting;
  143. --
  144. 2.11.0