82 lines
3.4 KiB
Diff
82 lines
3.4 KiB
Diff
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
Date: Sun, 18 Nov 2018 13:06:49 +0100
|
|
Subject: Add flag to disable IPv6 probes
|
|
|
|
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
|
---
|
|
.../about_flags_cc/add-flag-to-disable-IPv6-probes.inc | 8 ++++++++
|
|
.../base/features_cc/add-flag-to-disable-IPv6-probes.inc | 3 +++
|
|
.../base/features_h/add-flag-to-disable-IPv6-probes.inc | 2 ++
|
|
net/BUILD.gn | 1 +
|
|
net/dns/host_resolver_manager.cc | 8 ++++++++
|
|
5 files changed, 22 insertions(+)
|
|
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc
|
|
create mode 100644 cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc
|
|
create mode 100644 cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc
|
|
|
|
diff --git a/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc
|
|
@@ -0,0 +1,8 @@
|
|
+#ifdef FLAG_SECTION
|
|
+
|
|
+ {"ipv6-probing",
|
|
+ "Enable IPv6 probing.",
|
|
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.", kOsAll,
|
|
+ FEATURE_VALUE_TYPE(net::features::kIPv6Probing)},
|
|
+
|
|
+#endif // ifdef FLAG_SECTION
|
|
diff --git a/cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc b/cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc
|
|
@@ -0,0 +1,3 @@
|
|
+CROMITE_FEATURE(kIPv6Probing,
|
|
+ "IPv6Probing",
|
|
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
|
diff --git a/cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc b/cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc
|
|
@@ -0,0 +1,2 @@
|
|
+// Enable IPv6 ping probes to RIPE DNS.
|
|
+NET_EXPORT BASE_DECLARE_FEATURE(kIPv6Probing);
|
|
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
|
--- a/net/BUILD.gn
|
|
+++ b/net/BUILD.gn
|
|
@@ -1219,6 +1219,7 @@ component("net") {
|
|
":net_deps",
|
|
"//components/network_time/time_tracker",
|
|
"//components/unexportable_keys",
|
|
+ "//components/network_session_configurator/common",
|
|
"//net/http:transport_security_state_generated_files",
|
|
"//third_party/simdutf",
|
|
]
|
|
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
|
|
--- a/net/dns/host_resolver_manager.cc
|
|
+++ b/net/dns/host_resolver_manager.cc
|
|
@@ -114,6 +114,7 @@
|
|
#include "net/log/net_log_event_type.h"
|
|
#include "net/log/net_log_source.h"
|
|
#include "net/log/net_log_source_type.h"
|
|
+#include "services/network/public/cpp/features.h"
|
|
#include "net/log/net_log_with_source.h"
|
|
#include "net/socket/client_socket_factory.h"
|
|
#include "net/url_request/url_request_context.h"
|
|
@@ -1505,6 +1506,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck(
|
|
return OK;
|
|
}
|
|
|
|
+ if (!base::FeatureList::IsEnabled(net::features::kIPv6Probing)) {
|
|
+ probing_ipv6_ = false;
|
|
+ last_ipv6_probe_result_ = false;
|
|
+ last_ipv6_probe_time_ = base::TimeTicks();
|
|
+ return OK;
|
|
+ }
|
|
+
|
|
if (probing_ipv6_) {
|
|
ipv6_request_callbacks_.push_back(std::move(callback));
|
|
return ERR_IO_PENDING;
|
|
--
|