File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / dnsmasq / contrib / try-all-ns / dnsmasq-2.78xx-try-all-ns.patch
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:56:46 2021 UTC (3 years, 9 months ago) by misho
Branches: dnsmasq, MAIN
CVS tags: v8_2p1, v2_84, HEAD
dnsmasq 2.84

diff --git a/src/forward.c b/src/forward.c
index e3fa94b..ecf3b98 100644
--- a/src/forward.c
+++ b/src/forward.c
@@ -789,9 +789,12 @@ void reply_query(int fd, int family, time_t now)
 
   /* Note: if we send extra options in the EDNS0 header, we can't recreate
      the query from the reply. */
-  if (RCODE(header) == REFUSED &&
-      forward->forwardall == 0 &&
-      !(forward->flags & FREC_HAS_EXTRADATA))
+  if ((RCODE(header) == REFUSED &&
+        forward->forwardall == 0 &&
+       !(forward->flags & FREC_HAS_EXTRADATA)) ||
+      /* If strict-order is set, try next server on NXDOMAIN reply */
+      (RCODE(header) == NXDOMAIN && option_bool(OPT_ORDER) &&
+       server->next != NULL))
     /* for broken servers, attempt to send to another one. */
     {
       unsigned char *pheader;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>