]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
iterate: allow lame negative answers in PERMISSIVE mode
authorMarek Vavruša <mvavrusa@cloudflare.com>
Mon, 9 Apr 2018 07:01:53 +0000 (00:01 -0700)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 23 Apr 2018 15:49:34 +0000 (17:49 +0200)
Some nameservers are hopelessly broken (ns1-ord.salesforce.com),
and will return lame negative answers which will flag the nameserver
as bad, so it wouldn't be picked for valid queries.

lib/layer/iterate.c

index 4dad4d5ffbabeba778c7cb312c41e4186e439a43..3e0e1acde4cc16e1020e7e5d919d8bfd292b2a6a 100644 (file)
@@ -109,6 +109,12 @@ static bool is_authoritative(const knot_pkt_t *answer, struct kr_query *query)
                return true;
        }
 #endif
+
+       /* Some authoritative servers are hopelessly broken, allow lame answers in permissive mode. */
+       if (query->flags.PERMISSIVE) {
+               return true;
+       }
+
        return false;
 }