]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Treat REFUSED (not SERVFAIL) as an unsuccessful upstream response
authorChris Novakovic <chris@chrisn.me.uk>
Mon, 25 Jan 2016 21:54:35 +0000 (21:54 +0000)
committerSimon Kelley <simon@thekelleys.org.uk>
Mon, 25 Jan 2016 21:54:35 +0000 (21:54 +0000)
Commit 51967f9807665dae403f1497b827165c5fa1084b began treating SERVFAIL
as a successful response from an upstream server (thus ignoring future
responses to the query from other upstream servers), but a typo in that
commit means that REFUSED responses are accidentally being treated as
successful instead of SERVFAIL responses.

This commit corrects this typo and provides the behaviour intended by
commit 51967f9: SERVFAIL responses are considered successful (and will
be sent back to the requester), while REFUSED responses are considered
unsuccessful (and dnsmasq will wait for responses from other upstream
servers that haven't responded yet).

src/forward.c

index 414f988498a9218de977b8621d0e2ac4ee19bdc4..9b464d35d982c35ab6a830d9b70965f95658338d 100644 (file)
@@ -853,7 +853,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) != SERVFAIL)
+  if (forward->forwardall == 0 || --forward->forwardall == 1 || RCODE(header) != REFUSED)
     {
       int check_rebind = 0, no_cache_dnssec = 0, cache_secure = 0, bogusanswer = 0;