78 lines
2.5 KiB
Diff
78 lines
2.5 KiB
Diff
--- net/dns/host_resolver_manager.cc.orig 2020-10-09 16:39:12.064069835 -0400
|
|
+++ net/dns/host_resolver_manager.cc 2020-10-09 16:42:49.738302772 -0400
|
|
@@ -2779,8 +2779,7 @@
|
|
NetworkChangeNotifier::AddConnectionTypeObserver(this);
|
|
if (system_dns_config_notifier_)
|
|
system_dns_config_notifier_->AddObserver(this);
|
|
-#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
|
|
- !defined(OS_ANDROID)
|
|
+#if defined(__GLIBC__)
|
|
EnsureDnsReloaderInit();
|
|
#endif
|
|
|
|
--- net/dns/dns_reloader.cc.orig 2020-10-09 16:39:12.064069835 -0400
|
|
+++ net/dns/dns_reloader.cc 2020-10-09 16:44:30.442419823 -0400
|
|
@@ -4,9 +4,8 @@
|
|
|
|
#include "net/dns/dns_reloader.h"
|
|
|
|
-#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \
|
|
- !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
|
|
-
|
|
+#if defined(__GLIBC__)
|
|
+
|
|
#include <resolv.h>
|
|
|
|
#include "base/lazy_instance.h"
|
|
--- net/dns/host_resolver_proc.cc.orig 2020-10-09 16:39:12.065069836 -0400
|
|
+++ net/dns/host_resolver_proc.cc 2020-10-09 16:45:09.641466644 -0400
|
|
@@ -159,8 +159,7 @@
|
|
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
|
base::BlockingType::WILL_BLOCK);
|
|
|
|
-#if defined(OS_POSIX) && \
|
|
- !(defined(OS_APPLE) || defined(OS_OPENBSD) || defined(OS_ANDROID))
|
|
+#if defined(__GLIBC__)
|
|
DnsReloaderMaybeReload();
|
|
#endif
|
|
base::Optional<AddressInfo> ai;
|
|
--- net/dns/dns_config_service_linux.cc.orig
|
|
+++ net/dns/dns_config_service_linux.cc
|
|
@@ -443,11 +443,13 @@
|
|
base::ScopedBlockingCall scoped_blocking_call(
|
|
FROM_HERE, base::BlockingType::MAY_BLOCK);
|
|
|
|
+#if defined(__GLIBC__)
|
|
std::unique_ptr<struct __res_state> res = resolv_reader_->GetResState();
|
|
if (res) {
|
|
dns_config_ = ConvertResStateToDnsConfig(*res.get());
|
|
resolv_reader_->CloseResState(res.get());
|
|
}
|
|
+#endif
|
|
|
|
UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.Resolv.Read",
|
|
dns_config_.has_value());
|
|
--- net/dns/public/resolv_reader.cc.orig
|
|
+++ net/dns/public/resolv_reader.cc
|
|
@@ -20,19 +20,10 @@
|
|
namespace net {
|
|
|
|
std::unique_ptr<struct __res_state> ResolvReader::GetResState() {
|
|
- auto res = std::make_unique<struct __res_state>();
|
|
- memset(res.get(), 0, sizeof(struct __res_state));
|
|
-
|
|
- if (res_ninit(res.get()) != 0) {
|
|
- CloseResState(res.get());
|
|
- return nullptr;
|
|
- }
|
|
-
|
|
- return res;
|
|
+ return nullptr;
|
|
}
|
|
|
|
void ResolvReader::CloseResState(struct __res_state* res) {
|
|
- res_nclose(res);
|
|
}
|
|
|
|
absl::optional<std::vector<IPEndPoint>> GetNameservers(
|