Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: net/dns/dns_config_service_posix.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/dns/dns_config_service_posix.cc
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
index 6b79f9c2e0a17051f4376359e53469fbbd54d6fe..4f6888b49b2442dd4309527363d012e5fb962423 100644
--- a/net/dns/dns_config_service_posix.cc
+++ b/net/dns/dns_config_service_posix.cc
@@ -411,9 +411,9 @@ ConfigParsePosixResult ConvertResStateToDnsConfig(const struct __res_state& res,
dns_config->nameservers.push_back(ipe);
}
#elif defined(OS_LINUX)
- COMPILE_ASSERT(arraysize(res.nsaddr_list) >= MAXNS &&
- arraysize(res._u._ext.nsaddrs) >= MAXNS,
- incompatible_libresolv_res_state);
+ static_assert(arraysize(res.nsaddr_list) >= MAXNS &&
+ arraysize(res._u._ext.nsaddrs) >= MAXNS,
+ "incompatible libresolv res_state");
DCHECK_LE(res.nscount, MAXNS);
// Initially, glibc stores IPv6 in |_ext.nsaddrs| and IPv4 in |nsaddr_list|.
// In res_send.c:res_nsend, it merges |nsaddr_list| into |nsaddrs|,
@@ -459,7 +459,14 @@ ConfigParsePosixResult ConvertResStateToDnsConfig(const struct __res_state& res,
#if defined(RES_ROTATE)
dns_config->rotate = res.options & RES_ROTATE;
#endif
+#if defined(RES_USE_EDNS0)
dns_config->edns0 = res.options & RES_USE_EDNS0;
+#endif
+#if !defined(RES_USE_DNSSEC)
+ // Some versions of libresolv don't have support for the DO bit. In this
+ // case, we proceed without it.
+ static const int RES_USE_DNSSEC = 0;
+#endif
// The current implementation assumes these options are set. They normally
// cannot be overwritten by /etc/resolv.conf
« no previous file with comments | « net/disk_cache/simple/simple_test_util.h ('k') | net/dns/dns_session.cc » ('j') | shell/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698