|
|
@ -1,31 +1,34 @@ |
|
|
|
From ea1afcebbc2e1a87dddee231b48da5a891461ff9 Mon Sep 17 00:00:00 2001 |
|
|
|
From d1f59b4cf6af36572dbd0414eab588e0222de8c5 Mon Sep 17 00:00:00 2001 |
|
|
|
From: Brent Cook <busterb@gmail.com> |
|
|
|
Date: Mon, 8 Jun 2020 06:53:10 -0500 |
|
|
|
Subject: [PATCH 16/18] Don't retry DNS if Checking Disable flag is not |
|
|
|
available. |
|
|
|
|
|
|
|
---
|
|
|
|
src/usr.sbin/ntpd/config.c | 4 +++- |
|
|
|
src/usr.sbin/ntpd/config.c | 7 +++++-- |
|
|
|
src/usr.sbin/ntpd/ntp_dns.c | 8 +++++--- |
|
|
|
2 files changed, 8 insertions(+), 4 deletions(-) |
|
|
|
2 files changed, 10 insertions(+), 5 deletions(-) |
|
|
|
|
|
|
|
diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
|
|
|
|
index 856c3147cc..fc9df84bc4 100644
|
|
|
|
index 856c3147cc..f89742916a 100644
|
|
|
|
--- a/src/usr.sbin/ntpd/config.c
|
|
|
|
+++ b/src/usr.sbin/ntpd/config.c
|
|
|
|
@@ -138,9 +138,10 @@ int
|
|
|
|
@@ -137,17 +137,20 @@ host_dns1(const char *s, struct ntp_addr **hn, int notauth)
|
|
|
|
int |
|
|
|
host_dns(const char *s, int synced, struct ntp_addr **hn) |
|
|
|
{ |
|
|
|
int error, save_opts; |
|
|
|
- int error, save_opts;
|
|
|
|
-
|
|
|
|
+ int error;
|
|
|
|
+
|
|
|
|
log_debug("trying to resolve %s", s); |
|
|
|
error = host_dns1(s, hn, 0); |
|
|
|
+#ifdef RES_USE_CD
|
|
|
|
if (!synced && error <= 0) { |
|
|
|
+ int save_opts;
|
|
|
|
log_debug("no luck, trying to resolve %s without checking", s); |
|
|
|
save_opts = _res.options; |
|
|
|
@@ -148,6 +149,7 @@ host_dns(const char *s, int synced, struct ntp_addr **hn)
|
|
|
|
_res.options |= RES_USE_CD; |
|
|
|
error = host_dns1(s, hn, 1); |
|
|
|
_res.options = save_opts; |
|
|
|
} |
|
|
|