diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2014-03-25 21:07:00 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2014-03-25 21:07:00 +0000 |
commit | 51967f9807665dae403f1497b827165c5fa1084b (patch) | |
tree | 1037234f1b9b9a15d4c0709ee718021ef24eaf1d | |
parent | b37f8b99ae7ef73aaee5fd8db6b1693354ac40cf (diff) | |
download | dnsmasq-51967f9807665dae403f1497b827165c5fa1084b.tar.gz |
SERVFAIL is an expected error return, don't try all servers.
-rw-r--r-- | src/forward.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/forward.c b/src/forward.c index 7e87733..d9a41ba 100644 --- a/src/forward.c +++ b/src/forward.c @@ -751,7 +751,7 @@ void reply_query(int fd, int family, time_t now) if ((forward->sentto->flags & SERV_TYPE) == 0) { - if (RCODE(header) == SERVFAIL || RCODE(header) == REFUSED) + if (RCODE(header) == REFUSED) server = NULL; else { @@ -774,8 +774,7 @@ void reply_query(int fd, int family, time_t now) we get a good reply from another server. Kill it when we've had replies from all to avoid filling the forwarding table when everything is broken */ - if (forward->forwardall == 0 || --forward->forwardall == 1 || - (RCODE(header) != REFUSED && RCODE(header) != SERVFAIL)) + if (forward->forwardall == 0 || --forward->forwardall == 1 || RCODE(header) != SERVFAIL) { int check_rebind = 0, no_cache_dnssec = 0, cache_secure = 0; @@ -788,7 +787,7 @@ void reply_query(int fd, int family, time_t now) no_cache_dnssec = 1; #ifdef HAVE_DNSSEC - if (option_bool(OPT_DNSSEC_VALID) && !(forward->flags & FREC_CHECKING_DISABLED)) + if (server && option_bool(OPT_DNSSEC_VALID) && !(forward->flags & FREC_CHECKING_DISABLED)) { int status; |