93 lines
3.9 KiB
Diff
93 lines
3.9 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
|
|
---
|
|
.../add-flag-to-disable-IPv6-probes.inc | 8 ++++++++
|
|
.../features_cc/add-flag-to-disable-IPv6-probes.inc | 3 +++
|
|
.../features_h/add-flag-to-disable-IPv6-probes.inc | 2 ++
|
|
net/BUILD.gn | 1 +
|
|
net/dns/host_resolver_manager.cc | 11 +++++++++++
|
|
5 files changed, 25 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
|
|
@@ -1094,6 +1094,7 @@ component("net") {
|
|
"//build:chromeos_buildflags",
|
|
"//net/data/ssl/chrome_root_store:gen_root_store_inc",
|
|
"//net/http:transport_security_state_generated_files",
|
|
+ "//components/network_session_configurator/common"
|
|
]
|
|
|
|
public_deps = [
|
|
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
|
|
@@ -110,6 +110,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"
|
|
@@ -685,6 +686,9 @@ class HostResolverManager::RequestImpl
|
|
// request source is LOCAL_ONLY. This is due to LOCAL_ONLY requiring a
|
|
// synchronous response, so it cannot wait on an async probe result and
|
|
// cannot make assumptions about reachability.
|
|
+ if (!base::FeatureList::IsEnabled(features::kIPv6Probing)) {
|
|
+ return OK;
|
|
+ }
|
|
if (parameters_.source == HostResolverSource::LOCAL_ONLY) {
|
|
int rv = resolver_->StartIPv6ReachabilityCheck(
|
|
source_net_log_, GetClientSocketFactory(),
|
|
@@ -3903,6 +3907,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;
|
|
--
|
|
2.25.1
|