]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that there was no OPT record before falling back
authorMark Andrews <marka@isc.org>
Mon, 1 Feb 2021 02:05:08 +0000 (13:05 +1100)
committerMark Andrews <marka@isc.org>
Mon, 12 Jul 2021 02:30:03 +0000 (12:30 +1000)
to plain DNS on FORMERR.

lib/dns/resolver.c
lib/dns/zone.c

index 847ead38a856ae560c2b3b5ab1dc90e62e323159..ebc7fbc2cfcd9d1bf948ad3227c4f4189f60d43d 100644 (file)
@@ -10005,7 +10005,7 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) {
                return (ISC_R_SUCCESS);
        }
 
-       if ((rcode == dns_rcode_formerr) &&
+       if ((rcode == dns_rcode_formerr) && rctx->opt == NULL &&
            (rctx->retryopts & DNS_FETCHOPT_NOEDNS0) == 0)
        {
                /*
index 70528f448b853c306562445d3426937025cbeda8..6f32655a1878d2d0eb6874ff3776aa140200a416 100644 (file)
@@ -13606,7 +13606,7 @@ stub_callback(isc_task_t *task, isc_event_t *event) {
                if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOEDNS) &&
                    (msg->rcode == dns_rcode_servfail ||
                     msg->rcode == dns_rcode_notimp ||
-                    msg->rcode == dns_rcode_formerr))
+                    (msg->rcode == dns_rcode_formerr && msg->opt == NULL)))
                {
                        dns_zone_log(zone, ISC_LOG_DEBUG(1),
                                     "refreshing stub: rcode (%.*s) retrying "
@@ -13995,7 +13995,7 @@ refresh_callback(isc_task_t *task, isc_event_t *event) {
                if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOEDNS) &&
                    (msg->rcode == dns_rcode_servfail ||
                     msg->rcode == dns_rcode_notimp ||
-                    msg->rcode == dns_rcode_formerr))
+                    (msg->rcode == dns_rcode_formerr && msg->opt == NULL)))
                {
                        dns_zone_log(zone, ISC_LOG_DEBUG(1),
                                     "refresh: rcode (%.*s) retrying without "