Skip to content

Commit 699e312

Browse files
dedeckehjow-
authored andcommitted
dnsmasq: backport patch fixing DNS failover (FS#841)
Backport upstream dnsmasq patch fixing DNS failover when first servers returns REFUSED in strict mode; fixes issue FS#841. Signed-off-by: Hans Dedecker <[email protected]>
1 parent d0ec502 commit 699e312

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 9396752c115b3ab733fa476b30da73237e12e7ba Mon Sep 17 00:00:00 2001
2+
From: Hans Dedecker <[email protected]>
3+
Date: Tue, 27 Jun 2017 22:08:47 +0100
4+
Subject: [PATCH] Try other servers if first returns REFUSED when
5+
--strict-order active.
6+
7+
If a DNS server replies REFUSED for a given DNS query in strict order mode
8+
no failover to the next DNS server is triggered as the failover logic only
9+
covers non strict mode.
10+
As a result the client will be returned the REFUSED reply without first
11+
falling back to the secondary DNS server(s).
12+
13+
Make failover support work as well for strict mode config in case REFUSED is
14+
replied by deleting the strict order check and rely only on forwardall being
15+
equal to 0 which is the case in non strict mode when a single server has been
16+
contacted or when strict order mode has been configured.
17+
---
18+
CHANGELOG | 4 ++++
19+
src/forward.c | 1 -
20+
2 files changed, 4 insertions(+), 1 deletion(-)
21+
22+
--- a/src/forward.c
23+
+++ b/src/forward.c
24+
@@ -790,7 +790,6 @@ void reply_query(int fd, int family, tim
25+
/* Note: if we send extra options in the EDNS0 header, we can't recreate
26+
the query from the reply. */
27+
if (RCODE(header) == REFUSED &&
28+
- !option_bool(OPT_ORDER) &&
29+
forward->forwardall == 0 &&
30+
!(forward->flags & FREC_HAS_EXTRADATA))
31+
/* for broken servers, attempt to send to another one. */

0 commit comments

Comments
 (0)