From b4b1d9014418d4fa48bf9dc7887112e28f7ff04a Mon Sep 17 00:00:00 2001 From: Eloston Date: Sun, 16 Oct 2022 06:03:21 +0000 Subject: [PATCH 01/14] Re-enable mDNS --- flags.gn | 1 - ...g-without-mdns-and-service-discovery.patch | 42 ------------------- patches/series | 1 - 3 files changed, 44 deletions(-) delete mode 100644 patches/extra/ungoogled-chromium/fix-building-without-mdns-and-service-discovery.patch diff --git a/flags.gn b/flags.gn index 10cd77df21..4498683b15 100644 --- a/flags.gn +++ b/flags.gn @@ -4,7 +4,6 @@ clang_use_chrome_plugins=false disable_fieldtrial_testing_config=true enable_hangout_services_extension=false enable_js_type_check=false -enable_mdns=false enable_mse_mpeg2ts_stream_parser=true enable_nacl=false enable_reading_list=false diff --git a/patches/extra/ungoogled-chromium/fix-building-without-mdns-and-service-discovery.patch b/patches/extra/ungoogled-chromium/fix-building-without-mdns-and-service-discovery.patch deleted file mode 100644 index 2b0ee0bcb5..0000000000 --- a/patches/extra/ungoogled-chromium/fix-building-without-mdns-and-service-discovery.patch +++ /dev/null @@ -1,42 +0,0 @@ -# Fix building with enable_service_discovery=false and enable_mds=false - ---- a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc -+++ b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc -@@ -40,37 +40,22 @@ DnsSdDeviceLister::DnsSdDeviceLister( - DnsSdDeviceLister::~DnsSdDeviceLister() {} - - void DnsSdDeviceLister::Discover() { --#if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) -- if (!device_lister_) { -- device_lister_ = local_discovery::ServiceDiscoveryDeviceLister::Create( -- this, service_discovery_client_, service_type_); -- device_lister_->Start(); -- } -- device_lister_->DiscoverNewDevices(); --#endif - } - - void DnsSdDeviceLister::Reset() { -- device_lister_.reset(); - } - - void DnsSdDeviceLister::OnDeviceChanged( - const std::string& service_type, - bool added, - const ServiceDescription& service_description) { -- DnsSdService service; -- FillServiceInfo(service_description, &service); -- delegate_->ServiceChanged(device_lister_->service_type(), added, service); - } - - void DnsSdDeviceLister::OnDeviceRemoved(const std::string& service_type, - const std::string& service_name) { -- delegate_->ServiceRemoved(service_type, service_name); - } - - void DnsSdDeviceLister::OnDeviceCacheFlushed(const std::string& service_type) { -- delegate_->ServicesFlushed(device_lister_->service_type()); -- device_lister_->DiscoverNewDevices(); - } - - } // namespace media_router diff --git a/patches/series b/patches/series index 301fe9d97c..369e502fba 100644 --- a/patches/series +++ b/patches/series @@ -61,7 +61,6 @@ extra/ungoogled-chromium/remove-disable-setuid-sandbox-as-bad-flag.patch extra/ungoogled-chromium/disable-intranet-redirect-detector.patch extra/ungoogled-chromium/enable-page-saving-on-more-pages.patch extra/ungoogled-chromium/disable-download-quarantine.patch -extra/ungoogled-chromium/fix-building-without-mdns-and-service-discovery.patch extra/ungoogled-chromium/add-flag-to-configure-extension-downloading.patch extra/ungoogled-chromium/add-flag-for-search-engine-collection.patch extra/ungoogled-chromium/add-flag-to-disable-beforeunload.patch From 437a1704f6fb1f7d9c6c1850269abaf682d2821b Mon Sep 17 00:00:00 2001 From: Eloston Date: Sun, 16 Oct 2022 06:21:18 +0000 Subject: [PATCH 02/14] Re-enable service discovery --- flags.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/flags.gn b/flags.gn index 4498683b15..0ad43f69e9 100644 --- a/flags.gn +++ b/flags.gn @@ -9,7 +9,6 @@ enable_nacl=false enable_reading_list=false enable_remoting=false enable_reporting=false -enable_service_discovery=false enable_widevine=true exclude_unwind_tables=true google_api_key="" From 4caa5834df2e5e661e169a4d229343dfdf53975e Mon Sep 17 00:00:00 2001 From: Eloston Date: Sun, 23 Oct 2022 19:16:28 +0000 Subject: [PATCH 03/14] Add flag to disable mDNS and Service Discovery --- .../add-flag-to-disable-mdns.patch | 220 ++++++++++++++++++ patches/series | 1 + 2 files changed, 221 insertions(+) create mode 100644 patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch new file mode 100644 index 0000000000..68be8e3949 --- /dev/null +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -0,0 +1,220 @@ +--- a/chrome/browser/devtools/BUILD.gn ++++ b/chrome/browser/devtools/BUILD.gn +@@ -107,6 +107,7 @@ static_library("devtools") { + "//components/paint_preview/buildflags:buildflags", + "//content/public/browser", + "//net", ++ "//services/network/public/cpp", + "//services/viz/privileged/mojom/compositing", + "//third_party/blink/public:buildflags", + "//ui/events:dom_keycode_converter", +--- a/chrome/browser/devtools/device/devtools_android_bridge.cc ++++ b/chrome/browser/devtools/device/devtools_android_bridge.cc +@@ -17,6 +17,7 @@ + #include "base/callback_helpers.h" + #include "base/command_line.h" + #include "base/compiler_specific.h" ++#include "base/feature_list.h" + #include "base/json/json_reader.h" + #include "base/lazy_instance.h" + #include "base/memory/singleton.h" +@@ -44,6 +45,7 @@ + #include "content/public/browser/devtools_external_agent_proxy_delegate.h" + #include "net/base/host_port_pair.h" + #include "net/base/net_errors.h" ++#include "services/network/public/cpp/features.h" + + #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) + #include "chrome/browser/devtools/device/cast_device_provider.h" +@@ -372,7 +374,9 @@ void DevToolsAndroidBridge::CreateDevice + device_providers.push_back(provider); + + #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) +- device_providers.push_back(new CastDeviceProvider()); ++ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns)) { ++ device_providers.push_back(new CastDeviceProvider()); ++ } + #endif + + device_providers.push_back(new AdbDeviceProvider()); +--- a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc ++++ b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc +@@ -4,7 +4,9 @@ + + #include "chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h" + ++#include "base/feature_list.h" + #include "chrome/browser/media/router/discovery/mdns/dns_sd_delegate.h" ++#include "services/network/public/cpp/features.h" + + using local_discovery::ServiceDescription; + +@@ -28,7 +30,8 @@ DnsSdDeviceLister::DnsSdDeviceLister( + local_discovery::ServiceDiscoveryClient* service_discovery_client, + DnsSdDelegate* delegate, + const std::string& service_type) +- : delegate_(delegate) ++ : delegate_(delegate), ++ enable_mdns_(!base::FeatureList::IsEnabled(network::features::kDisableMdns)) + #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) + , + service_discovery_client_(service_discovery_client), +@@ -41,36 +44,46 @@ DnsSdDeviceLister::~DnsSdDeviceLister() + + void DnsSdDeviceLister::Discover() { + #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) +- if (!device_lister_) { +- device_lister_ = local_discovery::ServiceDiscoveryDeviceLister::Create( +- this, service_discovery_client_, service_type_); +- device_lister_->Start(); ++ if (enable_mdns_) { ++ if (!device_lister_) { ++ device_lister_ = local_discovery::ServiceDiscoveryDeviceLister::Create( ++ this, service_discovery_client_, service_type_); ++ device_lister_->Start(); ++ } ++ device_lister_->DiscoverNewDevices(); + } +- device_lister_->DiscoverNewDevices(); + #endif + } + + void DnsSdDeviceLister::Reset() { +- device_lister_.reset(); ++ if (enable_mdns_) { ++ device_lister_.reset(); ++ } + } + + void DnsSdDeviceLister::OnDeviceChanged( + const std::string& service_type, + bool added, + const ServiceDescription& service_description) { +- DnsSdService service; +- FillServiceInfo(service_description, &service); +- delegate_->ServiceChanged(device_lister_->service_type(), added, service); ++ if (enable_mdns_) { ++ DnsSdService service; ++ FillServiceInfo(service_description, &service); ++ delegate_->ServiceChanged(device_lister_->service_type(), added, service); ++ } + } + + void DnsSdDeviceLister::OnDeviceRemoved(const std::string& service_type, + const std::string& service_name) { +- delegate_->ServiceRemoved(service_type, service_name); ++ if (enable_mdns_) { ++ delegate_->ServiceRemoved(service_type, service_name); ++ } + } + + void DnsSdDeviceLister::OnDeviceCacheFlushed(const std::string& service_type) { +- delegate_->ServicesFlushed(device_lister_->service_type()); +- device_lister_->DiscoverNewDevices(); ++ if (enable_mdns_) { ++ delegate_->ServicesFlushed(device_lister_->service_type()); ++ device_lister_->DiscoverNewDevices(); ++ } + } + + } // namespace media_router +--- a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h ++++ b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h +@@ -57,6 +57,8 @@ class DnsSdDeviceLister + // Created when Discover() is called, if service discovery is enabled. + std::unique_ptr device_lister_; + ++ const bool enable_mdns_; ++ + #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) + // The client and service type used to create |device_lister_|. + const raw_ptr +--- a/chrome/browser/ungoogled_flag_entries.h ++++ b/chrome/browser/ungoogled_flag_entries.h +@@ -116,4 +116,8 @@ + "Hide Extensions Menu", + "Hides the extensions menu (the puzzle piece icon). ungoogled-chromium flag.", + kOsDesktop, SINGLE_VALUE_TYPE("hide-extensions-menu")}, ++ {"disable-mdns", ++ "Disable mDNS", ++ "Disables mDNS and Service Discovery. ungoogled-chromium flag.", ++ kOsAll, FEATURE_VALUE_TYPE(network::features::kDisableMdns)}, + #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ +--- a/content/browser/direct_sockets/resolve_host_and_open_socket.cc ++++ b/content/browser/direct_sockets/resolve_host_and_open_socket.cc +@@ -4,6 +4,7 @@ + + #include "content/browser/direct_sockets/resolve_host_and_open_socket.h" + ++#include "base/feature_list.h" + #include "base/memory/scoped_refptr.h" + #include "base/metrics/histogram_functions.h" + #include "base/time/time.h" +@@ -13,6 +14,7 @@ + #include "net/base/ip_endpoint.h" + #include "net/http/http_response_headers.h" + #include "net/net_buildflags.h" ++#include "services/network/public/cpp/features.h" + #include "services/network/public/cpp/resource_request.h" + #include "services/network/public/cpp/simple_url_loader.h" + #include "services/network/public/mojom/network_context.mojom.h" +@@ -90,7 +92,7 @@ void ResolveHostAndOpenSocket::Start() { + network::mojom::ResolveHostParametersPtr parameters = + network::mojom::ResolveHostParameters::New(); + #if BUILDFLAG(ENABLE_MDNS) +- if (ResemblesMulticastDNSName(*options_->remote_hostname)) { ++ if (!base::FeatureList::IsEnabled(network::features::kDisableMDNS) && ResemblesMulticastDNSName(*options_->remote_hostname)) { + parameters->source = net::HostResolverSource::MULTICAST_DNS; + is_mdns_name_ = true; + } +--- a/services/network/p2p/socket_manager.cc ++++ b/services/network/p2p/socket_manager.cc +@@ -9,6 +9,7 @@ + #include + + #include "base/bind.h" ++#include "base/feature_list.h" + #include "base/memory/raw_ptr.h" + #include "base/task/thread_pool.h" + #include "base/threading/thread_task_runner_handle.h" +@@ -27,6 +28,7 @@ + #include "net/url_request/url_request_context_getter.h" + #include "services/network/p2p/socket.h" + #include "services/network/proxy_resolving_client_socket_factory.h" ++#include "services/network/public/cpp/features.h" + #include "services/network/public/cpp/p2p_param_traits.h" + #include "third_party/webrtc/media/base/rtp_utils.h" + #include "third_party/webrtc/media/base/turn_utils.h" +@@ -103,7 +105,7 @@ class P2PSocketManager::DnsRequest { + net::HostPortPair host(host_name_, 0); + + net::HostResolver::ResolveHostParameters parameters; +- if (enable_mdns_ && HasLocalTld(host_name_)) { ++ if (enable_mdns_ && HasLocalTld(host_name_) && !base::FeatureList::IsEnabled(feature::kDisableMdns)) { + #if BUILDFLAG(ENABLE_MDNS) + // HostResolver/MDnsClient expects a key without a trailing dot. + host.set_host(host_name_.substr(0, host_name_.size() - 1)); +--- a/services/network/public/cpp/features.cc ++++ b/services/network/public/cpp/features.cc +@@ -15,6 +15,9 @@ + namespace network { + namespace features { + ++const base::Feature kDisableMdns{"DisableMdns", ++ base::FEATURE_DISABLED_BY_DEFAULT}; ++ + // Enables Expect CT reporting, which sends reports for opted-in sites + // that don't serve sufficient Certificate Transparency information. + const base::Feature kExpectCTReporting{"ExpectCTReporting", +--- a/services/network/public/cpp/features.h ++++ b/services/network/public/cpp/features.h +@@ -14,6 +14,9 @@ namespace network { + namespace features { + + COMPONENT_EXPORT(NETWORK_CPP) ++extern const base::Feature kDisableMdns; ++ ++COMPONENT_EXPORT(NETWORK_CPP) + extern const base::Feature kExpectCTReporting; + COMPONENT_EXPORT(NETWORK_CPP) + extern const base::Feature kNetworkErrorLogging; diff --git a/patches/series b/patches/series index 369e502fba..496bdfe4b4 100644 --- a/patches/series +++ b/patches/series @@ -100,3 +100,4 @@ extra/ungoogled-chromium/add-flag-to-disable-sharing-hub.patch extra/ungoogled-chromium/add-flag-to-hide-side-panel-button.patch extra/ungoogled-chromium/add-flag-for-disabling-link-drag.patch extra/ungoogled-chromium/add-flag-to-hide-extensions-menu.patch +extra/ungoogled-chromium/add-flag-to-disable-mdns.patch From 1aad5fa89c348b78d42752a3afcac742794e80d2 Mon Sep 17 00:00:00 2001 From: Eloston Date: Mon, 24 Oct 2022 18:18:27 +0000 Subject: [PATCH 04/14] Fix typos --- .../extra/ungoogled-chromium/add-flag-to-disable-mdns.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index 68be8e3949..f7bf3f07ec 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -163,7 +163,7 @@ network::mojom::ResolveHostParameters::New(); #if BUILDFLAG(ENABLE_MDNS) - if (ResemblesMulticastDNSName(*options_->remote_hostname)) { -+ if (!base::FeatureList::IsEnabled(network::features::kDisableMDNS) && ResemblesMulticastDNSName(*options_->remote_hostname)) { ++ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns) && ResemblesMulticastDNSName(*options_->remote_hostname)) { parameters->source = net::HostResolverSource::MULTICAST_DNS; is_mdns_name_ = true; } @@ -190,7 +190,7 @@ net::HostResolver::ResolveHostParameters parameters; - if (enable_mdns_ && HasLocalTld(host_name_)) { -+ if (enable_mdns_ && HasLocalTld(host_name_) && !base::FeatureList::IsEnabled(feature::kDisableMdns)) { ++ if (enable_mdns_ && HasLocalTld(host_name_) && !base::FeatureList::IsEnabled(features::kDisableMdns)) { #if BUILDFLAG(ENABLE_MDNS) // HostResolver/MDnsClient expects a key without a trailing dot. host.set_host(host_name_.substr(0, host_name_.size() - 1)); From c0b871fda45f4f1dadad14653020071a5851a9ce Mon Sep 17 00:00:00 2001 From: Eloston Date: Sun, 30 Oct 2022 19:13:10 +0000 Subject: [PATCH 05/14] Rebase to 107 and address feedback --- .../add-flag-to-disable-mdns.patch | 174 ++++-------------- 1 file changed, 31 insertions(+), 143 deletions(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index f7bf3f07ec..f4950c85d4 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -1,134 +1,3 @@ ---- a/chrome/browser/devtools/BUILD.gn -+++ b/chrome/browser/devtools/BUILD.gn -@@ -107,6 +107,7 @@ static_library("devtools") { - "//components/paint_preview/buildflags:buildflags", - "//content/public/browser", - "//net", -+ "//services/network/public/cpp", - "//services/viz/privileged/mojom/compositing", - "//third_party/blink/public:buildflags", - "//ui/events:dom_keycode_converter", ---- a/chrome/browser/devtools/device/devtools_android_bridge.cc -+++ b/chrome/browser/devtools/device/devtools_android_bridge.cc -@@ -17,6 +17,7 @@ - #include "base/callback_helpers.h" - #include "base/command_line.h" - #include "base/compiler_specific.h" -+#include "base/feature_list.h" - #include "base/json/json_reader.h" - #include "base/lazy_instance.h" - #include "base/memory/singleton.h" -@@ -44,6 +45,7 @@ - #include "content/public/browser/devtools_external_agent_proxy_delegate.h" - #include "net/base/host_port_pair.h" - #include "net/base/net_errors.h" -+#include "services/network/public/cpp/features.h" - - #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) - #include "chrome/browser/devtools/device/cast_device_provider.h" -@@ -372,7 +374,9 @@ void DevToolsAndroidBridge::CreateDevice - device_providers.push_back(provider); - - #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) -- device_providers.push_back(new CastDeviceProvider()); -+ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns)) { -+ device_providers.push_back(new CastDeviceProvider()); -+ } - #endif - - device_providers.push_back(new AdbDeviceProvider()); ---- a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc -+++ b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.cc -@@ -4,7 +4,9 @@ - - #include "chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h" - -+#include "base/feature_list.h" - #include "chrome/browser/media/router/discovery/mdns/dns_sd_delegate.h" -+#include "services/network/public/cpp/features.h" - - using local_discovery::ServiceDescription; - -@@ -28,7 +30,8 @@ DnsSdDeviceLister::DnsSdDeviceLister( - local_discovery::ServiceDiscoveryClient* service_discovery_client, - DnsSdDelegate* delegate, - const std::string& service_type) -- : delegate_(delegate) -+ : delegate_(delegate), -+ enable_mdns_(!base::FeatureList::IsEnabled(network::features::kDisableMdns)) - #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) - , - service_discovery_client_(service_discovery_client), -@@ -41,36 +44,46 @@ DnsSdDeviceLister::~DnsSdDeviceLister() - - void DnsSdDeviceLister::Discover() { - #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) -- if (!device_lister_) { -- device_lister_ = local_discovery::ServiceDiscoveryDeviceLister::Create( -- this, service_discovery_client_, service_type_); -- device_lister_->Start(); -+ if (enable_mdns_) { -+ if (!device_lister_) { -+ device_lister_ = local_discovery::ServiceDiscoveryDeviceLister::Create( -+ this, service_discovery_client_, service_type_); -+ device_lister_->Start(); -+ } -+ device_lister_->DiscoverNewDevices(); - } -- device_lister_->DiscoverNewDevices(); - #endif - } - - void DnsSdDeviceLister::Reset() { -- device_lister_.reset(); -+ if (enable_mdns_) { -+ device_lister_.reset(); -+ } - } - - void DnsSdDeviceLister::OnDeviceChanged( - const std::string& service_type, - bool added, - const ServiceDescription& service_description) { -- DnsSdService service; -- FillServiceInfo(service_description, &service); -- delegate_->ServiceChanged(device_lister_->service_type(), added, service); -+ if (enable_mdns_) { -+ DnsSdService service; -+ FillServiceInfo(service_description, &service); -+ delegate_->ServiceChanged(device_lister_->service_type(), added, service); -+ } - } - - void DnsSdDeviceLister::OnDeviceRemoved(const std::string& service_type, - const std::string& service_name) { -- delegate_->ServiceRemoved(service_type, service_name); -+ if (enable_mdns_) { -+ delegate_->ServiceRemoved(service_type, service_name); -+ } - } - - void DnsSdDeviceLister::OnDeviceCacheFlushed(const std::string& service_type) { -- delegate_->ServicesFlushed(device_lister_->service_type()); -- device_lister_->DiscoverNewDevices(); -+ if (enable_mdns_) { -+ delegate_->ServicesFlushed(device_lister_->service_type()); -+ device_lister_->DiscoverNewDevices(); -+ } - } - - } // namespace media_router ---- a/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h -+++ b/chrome/browser/media/router/discovery/mdns/dns_sd_device_lister.h -@@ -57,6 +57,8 @@ class DnsSdDeviceLister - // Created when Discover() is called, if service discovery is enabled. - std::unique_ptr device_lister_; - -+ const bool enable_mdns_; -+ - #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) - // The client and service type used to create |device_lister_|. - const raw_ptr --- a/chrome/browser/ungoogled_flag_entries.h +++ b/chrome/browser/ungoogled_flag_entries.h @@ -116,4 +116,8 @@ @@ -150,7 +19,7 @@ #include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_functions.h" #include "base/time/time.h" -@@ -13,6 +14,7 @@ +@@ -14,6 +15,7 @@ #include "net/base/ip_endpoint.h" #include "net/http/http_response_headers.h" #include "net/net_buildflags.h" @@ -158,15 +27,34 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/network_context.mojom.h" -@@ -90,7 +92,7 @@ void ResolveHostAndOpenSocket::Start() { - network::mojom::ResolveHostParametersPtr parameters = - network::mojom::ResolveHostParameters::New(); +@@ -31,6 +33,9 @@ constexpr int kHttpsPort = 443; + #if BUILDFLAG(ENABLE_MDNS) -- if (ResemblesMulticastDNSName(*options_->remote_hostname)) { -+ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns) && ResemblesMulticastDNSName(*options_->remote_hostname)) { - parameters->source = net::HostResolverSource::MULTICAST_DNS; - is_mdns_name_ = true; - } + bool ResemblesMulticastDNSName(const std::string& hostname) { ++ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns) { ++ return false; ++ } + return base::EndsWith(hostname, ".local") || + base::EndsWith(hostname, ".local."); + } +@@ -368,4 +373,4 @@ void ResolveHostAndOpenUDPSocket::OnUdpC + delete this; + } + +-} // namespace content +\ No newline at end of file ++} // namespace content +--- a/net/dns/mdns_client_impl.cc ++++ b/net/dns/mdns_client_impl.cc +@@ -452,6 +452,8 @@ MDnsClientImpl::~MDnsClientImpl() { + } + + int MDnsClientImpl::StartListening(MDnsSocketFactory* socket_factory) { ++ if (base::FeatureList::IsEnabled(network::features::kDisableMdns)) ++ return ERR_ABORTED; + DCHECK(!core_.get()); + core_ = std::make_unique(clock_, cleanup_timer_.get()); + int rv = core_->Init(socket_factory); --- a/services/network/p2p/socket_manager.cc +++ b/services/network/p2p/socket_manager.cc @@ -9,6 +9,7 @@ @@ -177,15 +65,15 @@ #include "base/memory/raw_ptr.h" #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" -@@ -27,6 +28,7 @@ +@@ -29,6 +30,7 @@ #include "net/url_request/url_request_context_getter.h" #include "services/network/p2p/socket.h" #include "services/network/proxy_resolving_client_socket_factory.h" +#include "services/network/public/cpp/features.h" #include "services/network/public/cpp/p2p_param_traits.h" + #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/webrtc/media/base/rtp_utils.h" - #include "third_party/webrtc/media/base/turn_utils.h" -@@ -103,7 +105,7 @@ class P2PSocketManager::DnsRequest { +@@ -111,7 +113,7 @@ class P2PSocketManager::DnsRequest { net::HostPortPair host(host_name_, 0); net::HostResolver::ResolveHostParameters parameters; From 4556a237fb8766e54f95bb6df78a511a350fbbaa Mon Sep 17 00:00:00 2001 From: PF4Public Date: Sun, 11 Jun 2023 02:34:16 +0300 Subject: [PATCH 06/14] Update add-flag-to-disable-mdns.patch as suggested --- .../add-flag-to-disable-mdns.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index f4950c85d4..f038cd15c3 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -44,8 +44,27 @@ -} // namespace content \ No newline at end of file +} // namespace content +--- a/content/browser/direct_sockets/resolve_host_and_open_socket.cc ++++ b/content/browser/direct_sockets/resolve_host_and_open_socket.cc +@@ -33,7 +33,7 @@ + + #if BUILDFLAG(ENABLE_MDNS) + bool ResemblesMulticastDNSName(const std::string& hostname) { +- if (!base::FeatureList::IsEnabled(network::features::kDisableMdns) { ++ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns)) { + return false; + } + return base::EndsWith(hostname, ".local") || --- a/net/dns/mdns_client_impl.cc +++ b/net/dns/mdns_client_impl.cc +@@ -25,6 +25,7 @@ + #include "net/dns/public/util.h" + #include "net/dns/record_rdata.h" + #include "net/socket/datagram_socket.h" ++#include "services/network/public/cpp/features.h" + + // TODO(gene): Remove this temporary method of disabling NSEC support once it + // becomes clear whether this feature should be @@ -452,6 +452,8 @@ MDnsClientImpl::~MDnsClientImpl() { } From 203b30d16daa61b17a09a6d54ffd6e62ce4d4246 Mon Sep 17 00:00:00 2001 From: PF4Public Date: Sun, 11 Jun 2023 02:54:37 +0300 Subject: [PATCH 07/14] Replace diff hunk --- .../add-flag-to-disable-mdns.patch | 50 +++---------------- 1 file changed, 8 insertions(+), 42 deletions(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index f038cd15c3..913c09d555 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -9,52 +9,18 @@ + "Disables mDNS and Service Discovery. ungoogled-chromium flag.", + kOsAll, FEATURE_VALUE_TYPE(network::features::kDisableMdns)}, #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ ---- a/content/browser/direct_sockets/resolve_host_and_open_socket.cc -+++ b/content/browser/direct_sockets/resolve_host_and_open_socket.cc -@@ -4,6 +4,7 @@ +--- a/net/dns/host_resolver_manager.cc ++++ b/net/dns/host_resolver_manager.cc +@@ -184,6 +184,9 @@ - #include "content/browser/direct_sockets/resolve_host_and_open_socket.h" - -+#include "base/feature_list.h" - #include "base/memory/scoped_refptr.h" - #include "base/metrics/histogram_functions.h" - #include "base/time/time.h" -@@ -14,6 +15,7 @@ - #include "net/base/ip_endpoint.h" - #include "net/http/http_response_headers.h" - #include "net/net_buildflags.h" -+#include "services/network/public/cpp/features.h" - #include "services/network/public/cpp/resource_request.h" - #include "services/network/public/cpp/simple_url_loader.h" - #include "services/network/public/mojom/network_context.mojom.h" -@@ -31,6 +33,9 @@ constexpr int kHttpsPort = 443; - - #if BUILDFLAG(ENABLE_MDNS) - bool ResemblesMulticastDNSName(const std::string& hostname) { -+ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns) { -+ return false; -+ } + // True if |hostname| ends with either ".local" or ".local.". + bool ResemblesMulticastDNSName(base::StringPiece hostname) { ++ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns)) { ++ return false; ++ } return base::EndsWith(hostname, ".local") || base::EndsWith(hostname, ".local."); } -@@ -368,4 +373,4 @@ void ResolveHostAndOpenUDPSocket::OnUdpC - delete this; - } - --} // namespace content -\ No newline at end of file -+} // namespace content ---- a/content/browser/direct_sockets/resolve_host_and_open_socket.cc -+++ b/content/browser/direct_sockets/resolve_host_and_open_socket.cc -@@ -33,7 +33,7 @@ - - #if BUILDFLAG(ENABLE_MDNS) - bool ResemblesMulticastDNSName(const std::string& hostname) { -- if (!base::FeatureList::IsEnabled(network::features::kDisableMdns) { -+ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns)) { - return false; - } - return base::EndsWith(hostname, ".local") || --- a/net/dns/mdns_client_impl.cc +++ b/net/dns/mdns_client_impl.cc @@ -25,6 +25,7 @@ From ea1c1c40814a0b0804a38c4c195f9202a49fb978 Mon Sep 17 00:00:00 2001 From: PF4Public Date: Sun, 11 Jun 2023 03:16:05 +0300 Subject: [PATCH 08/14] fix patch --- .../add-flag-to-disable-mdns.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index 913c09d555..84271dece7 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -1,13 +1,13 @@ --- a/chrome/browser/ungoogled_flag_entries.h +++ b/chrome/browser/ungoogled_flag_entries.h -@@ -116,4 +116,8 @@ - "Hide Extensions Menu", - "Hides the extensions menu (the puzzle piece icon). ungoogled-chromium flag.", - kOsDesktop, SINGLE_VALUE_TYPE("hide-extensions-menu")}, -+ {"disable-mdns", -+ "Disable mDNS", -+ "Disables mDNS and Service Discovery. ungoogled-chromium flag.", -+ kOsAll, FEATURE_VALUE_TYPE(network::features::kDisableMdns)}, +@@ -132,4 +132,8 @@ + "Minimal Referrers", + "Removes all cross-origin referrers and strips same-origin referrers down to the origin. Has lower precedence than remove-cross-origin-referrers. ungoogled-chromium flag.", + kOsAll, FEATURE_VALUE_TYPE(features::kMinimalReferrers)}, ++ {"disable-mdns", ++ "Disable mDNS", ++ "Disables mDNS and Service Discovery. ungoogled-chromium flag.", ++ kOsAll, FEATURE_VALUE_TYPE(network::features::kDisableMdns)}, #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc From 32a68329cf135a57ed9f5c1fb65a4072e2489d74 Mon Sep 17 00:00:00 2001 From: PF4Public Date: Sun, 11 Jun 2023 14:01:44 +0300 Subject: [PATCH 09/14] refresh patches --- .../add-flag-to-disable-mdns.patch | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index 84271dece7..d25de129c2 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -11,7 +11,7 @@ #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc -@@ -184,6 +184,9 @@ +@@ -179,6 +179,9 @@ bool ContainsIcannNameCollisionIp(const // True if |hostname| ends with either ".local" or ".local.". bool ResemblesMulticastDNSName(base::StringPiece hostname) { @@ -23,15 +23,15 @@ } --- a/net/dns/mdns_client_impl.cc +++ b/net/dns/mdns_client_impl.cc -@@ -25,6 +25,7 @@ +@@ -26,6 +26,7 @@ #include "net/dns/public/util.h" #include "net/dns/record_rdata.h" #include "net/socket/datagram_socket.h" +#include "services/network/public/cpp/features.h" + #include "third_party/abseil-cpp/absl/types/optional.h" // TODO(gene): Remove this temporary method of disabling NSEC support once it - // becomes clear whether this feature should be -@@ -452,6 +452,8 @@ MDnsClientImpl::~MDnsClientImpl() { +@@ -455,6 +456,8 @@ MDnsClientImpl::~MDnsClientImpl() { } int MDnsClientImpl::StartListening(MDnsSocketFactory* socket_factory) { @@ -42,14 +42,14 @@ int rv = core_->Init(socket_factory); --- a/services/network/p2p/socket_manager.cc +++ b/services/network/p2p/socket_manager.cc -@@ -9,6 +9,7 @@ +@@ -8,6 +8,7 @@ + #include - #include "base/bind.h" +#include "base/feature_list.h" + #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" - #include "base/task/thread_pool.h" - #include "base/threading/thread_task_runner_handle.h" + #include "base/task/single_thread_task_runner.h" @@ -29,6 +30,7 @@ #include "net/url_request/url_request_context_getter.h" #include "services/network/p2p/socket.h" @@ -58,7 +58,7 @@ #include "services/network/public/cpp/p2p_param_traits.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/webrtc/media/base/rtp_utils.h" -@@ -111,7 +113,7 @@ class P2PSocketManager::DnsRequest { +@@ -114,7 +116,7 @@ class P2PSocketManager::DnsRequest { net::HostPortPair host(host_name_, 0); net::HostResolver::ResolveHostParameters parameters; @@ -69,25 +69,24 @@ host.set_host(host_name_.substr(0, host_name_.size() - 1)); --- a/services/network/public/cpp/features.cc +++ b/services/network/public/cpp/features.cc -@@ -15,6 +15,9 @@ - namespace network { - namespace features { +@@ -14,6 +14,10 @@ -+const base::Feature kDisableMdns{"DisableMdns", -+ base::FEATURE_DISABLED_BY_DEFAULT}; + namespace network::features { + ++BASE_FEATURE(kDisableMdns, ++ "DisableMdns", ++ base::FEATURE_DISABLED_BY_DEFAULT}; + - // Enables Expect CT reporting, which sends reports for opted-in sites - // that don't serve sufficient Certificate Transparency information. - const base::Feature kExpectCTReporting{"ExpectCTReporting", + BASE_FEATURE(kNetworkErrorLogging, + "NetworkErrorLogging", + base::FEATURE_ENABLED_BY_DEFAULT); --- a/services/network/public/cpp/features.h +++ b/services/network/public/cpp/features.h -@@ -14,6 +14,9 @@ namespace network { +@@ -13,6 +13,7 @@ + namespace network { namespace features { - COMPONENT_EXPORT(NETWORK_CPP) -+extern const base::Feature kDisableMdns; -+ -+COMPONENT_EXPORT(NETWORK_CPP) - extern const base::Feature kExpectCTReporting; - COMPONENT_EXPORT(NETWORK_CPP) - extern const base::Feature kNetworkErrorLogging; ++COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kDisableMdns); + COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kNetworkErrorLogging); + COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kReporting); + COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kThrottleDelayable); From 40f122a01121a2acfe70a45a6080d5e0cce0e19f Mon Sep 17 00:00:00 2001 From: PF4Public Date: Sun, 11 Jun 2023 15:17:27 +0300 Subject: [PATCH 10/14] Document `disable-mdns` flag --- docs/flags.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/flags.md b/docs/flags.md index 1d9369332d..961e3c4f8c 100644 --- a/docs/flags.md +++ b/docs/flags.md @@ -63,6 +63,7 @@ These are also available on the `chrome://flags` page. Feature | Description -- | -- + `DisableMdns` | Disables mDNS and Service Discovery. `MinimalReferrers` | Removes all cross-origin referrers and strips same-origin referrers down to the origin. Has lower precedence than `NoCrossOriginReferrers`. `NoCrossOriginReferrers` | Removes all cross-origin referrers. Has lower precedence than `NoReferrers`. `NoReferrers` | Removes all referrers. From e57d3e15f381b93fcc017ac8ac0e4ee9b3239fc3 Mon Sep 17 00:00:00 2001 From: Blaise Date: Wed, 14 Jun 2023 08:05:48 -0500 Subject: [PATCH 11/14] Fix brace --- patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index d25de129c2..41fd9f7cad 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -75,7 +75,7 @@ +BASE_FEATURE(kDisableMdns, + "DisableMdns", -+ base::FEATURE_DISABLED_BY_DEFAULT}; ++ base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kNetworkErrorLogging, "NetworkErrorLogging", From cc8115ff5d9e065b2370fd49a314c63ab3bb48a9 Mon Sep 17 00:00:00 2001 From: Blaise Date: Wed, 14 Jun 2023 08:13:20 -0500 Subject: [PATCH 12/14] Include features in host_resolver_manager --- .../ungoogled-chromium/add-flag-to-disable-mdns.patch | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index 41fd9f7cad..5a9e48eb9a 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -11,7 +11,15 @@ #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc -@@ -179,6 +179,9 @@ bool ContainsIcannNameCollisionIp(const +@@ -110,6 +110,7 @@ + #include "net/log/net_log_with_source.h" + #include "net/socket/client_socket_factory.h" + #include "net/url_request/url_request_context.h" ++#include "services/network/public/cpp/features.h" + #include "third_party/abseil-cpp/absl/types/optional.h" + #include "third_party/abseil-cpp/absl/types/variant.h" + #include "url/scheme_host_port.h" +@@ -179,6 +180,9 @@ bool ContainsIcannNameCollisionIp(const // True if |hostname| ends with either ".local" or ".local.". bool ResemblesMulticastDNSName(base::StringPiece hostname) { From f00f422172132a76ab0b3aac6f199b0ed5669610 Mon Sep 17 00:00:00 2001 From: Blaise Date: Sat, 17 Jun 2023 10:15:33 -0500 Subject: [PATCH 13/14] Fix inverted flag --- .../ungoogled-chromium/add-flag-to-disable-mdns.patch | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch index 5a9e48eb9a..cde378d6a9 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch @@ -19,13 +19,12 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/abseil-cpp/absl/types/variant.h" #include "url/scheme_host_port.h" -@@ -179,6 +180,9 @@ bool ContainsIcannNameCollisionIp(const +@@ -179,6 +180,8 @@ bool ContainsIcannNameCollisionIp(const // True if |hostname| ends with either ".local" or ".local.". bool ResemblesMulticastDNSName(base::StringPiece hostname) { -+ if (!base::FeatureList::IsEnabled(network::features::kDisableMdns)) { -+ return false; -+ } ++ if (base::FeatureList::IsEnabled(network::features::kDisableMdns)) ++ return false; return base::EndsWith(hostname, ".local") || base::EndsWith(hostname, ".local."); } From c6fa0d4936a4b1f17d0eee52b91b7deb0d41db2f Mon Sep 17 00:00:00 2001 From: Blaise Date: Fri, 30 Jun 2023 13:21:29 -0500 Subject: [PATCH 14/14] Invert flag --- docs/flags.md | 2 +- ...ns.patch => add-flag-to-enable-mdns.patch} | 20 +++++++++---------- patches/series | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename patches/extra/ungoogled-chromium/{add-flag-to-disable-mdns.patch => add-flag-to-enable-mdns.patch} (86%) diff --git a/docs/flags.md b/docs/flags.md index 06ab7d9ae0..23f2c0f308 100644 --- a/docs/flags.md +++ b/docs/flags.md @@ -63,7 +63,7 @@ These are also available on the `chrome://flags` page. Feature | Description -- | -- - `DisableMdns` | Disables mDNS and Service Discovery. + `Mdns` | Enables mDNS and Service Discovery. `MinimalReferrers` | Removes all cross-origin referrers and strips same-origin referrers down to the origin. Has lower precedence than `NoCrossOriginReferrers`. `NoCrossOriginReferrers` | Removes all cross-origin referrers. Has lower precedence than `NoReferrers`. `NoReferrers` | Removes all referrers. diff --git a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch b/patches/extra/ungoogled-chromium/add-flag-to-enable-mdns.patch similarity index 86% rename from patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch rename to patches/extra/ungoogled-chromium/add-flag-to-enable-mdns.patch index cde378d6a9..8d91b90161 100644 --- a/patches/extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +++ b/patches/extra/ungoogled-chromium/add-flag-to-enable-mdns.patch @@ -4,10 +4,10 @@ "Minimal Referrers", "Removes all cross-origin referrers and strips same-origin referrers down to the origin. Has lower precedence than remove-cross-origin-referrers. ungoogled-chromium flag.", kOsAll, FEATURE_VALUE_TYPE(features::kMinimalReferrers)}, -+ {"disable-mdns", -+ "Disable mDNS", -+ "Disables mDNS and Service Discovery. ungoogled-chromium flag.", -+ kOsAll, FEATURE_VALUE_TYPE(network::features::kDisableMdns)}, ++ {"enable-mdns", ++ "Enable mDNS", ++ "Enables mDNS and Service Discovery. ungoogled-chromium flag.", ++ kOsAll, FEATURE_VALUE_TYPE(network::features::kMdns)}, #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc @@ -23,7 +23,7 @@ // True if |hostname| ends with either ".local" or ".local.". bool ResemblesMulticastDNSName(base::StringPiece hostname) { -+ if (base::FeatureList::IsEnabled(network::features::kDisableMdns)) ++ if (!base::FeatureList::IsEnabled(network::features::kMdns)) + return false; return base::EndsWith(hostname, ".local") || base::EndsWith(hostname, ".local."); @@ -42,7 +42,7 @@ } int MDnsClientImpl::StartListening(MDnsSocketFactory* socket_factory) { -+ if (base::FeatureList::IsEnabled(network::features::kDisableMdns)) ++ if (!base::FeatureList::IsEnabled(network::features::kMdns)) + return ERR_ABORTED; DCHECK(!core_.get()); core_ = std::make_unique(clock_, cleanup_timer_.get()); @@ -70,7 +70,7 @@ net::HostResolver::ResolveHostParameters parameters; - if (enable_mdns_ && HasLocalTld(host_name_)) { -+ if (enable_mdns_ && HasLocalTld(host_name_) && !base::FeatureList::IsEnabled(features::kDisableMdns)) { ++ if (enable_mdns_ && HasLocalTld(host_name_) && base::FeatureList::IsEnabled(features::kMdns)) { #if BUILDFLAG(ENABLE_MDNS) // HostResolver/MDnsClient expects a key without a trailing dot. host.set_host(host_name_.substr(0, host_name_.size() - 1)); @@ -80,8 +80,8 @@ namespace network::features { -+BASE_FEATURE(kDisableMdns, -+ "DisableMdns", ++BASE_FEATURE(kMdns, ++ "Mdns", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kNetworkErrorLogging, @@ -93,7 +93,7 @@ namespace network { namespace features { -+COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kDisableMdns); ++COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kMdns); COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kNetworkErrorLogging); COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kReporting); COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kThrottleDelayable); diff --git a/patches/series b/patches/series index 469c672929..deaa0e94d5 100644 --- a/patches/series +++ b/patches/series @@ -103,4 +103,4 @@ extra/ungoogled-chromium/add-flags-for-referrer-customization.patch extra/ungoogled-chromium/default-webrtc-ip-handling-policy.patch extra/ungoogled-chromium/add-flags-for-existing-switches.patch extra/ungoogled-chromium/first-run-page.patch -extra/ungoogled-chromium/add-flag-to-disable-mdns.patch +extra/ungoogled-chromium/add-flag-to-enable-mdns.patch