]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix assertion failure during startup when the server is under load.
authorWitold Kręcicki <wpk@isc.org>
Thu, 21 May 2020 09:18:53 +0000 (11:18 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 1 Jul 2020 10:25:36 +0000 (12:25 +0200)
When we're coming back from recursion fetch_callback does not accept
DNS_R_NXDOMAIN as an rcode - query_gotanswer calls query_nxdomain in
which an assertion fails on qctx->is_zone. Yet, under some
circumstances, qname minimization will return an DNS_R_NXDOMAIN - when
root zone mirror is not yet loaded. The fix changes the DNS_R_NXDOMAIN
answer to DNS_R_SERVFAIL.

lib/dns/resolver.c

index 5a1f0c9f06a3592598620949fabf66d4e44f19fb..8aa78191e870cacd823a9f2e41b9b6e51d82d33d 100644 (file)
@@ -4397,6 +4397,15 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
                                      fctx->now, findoptions, true, true,
                                      &fctx->nameservers, NULL);
 
+       /*
+        * DNS_R_NXDOMAIN here means we have not loaded the root zone mirror
+        * yet - but DNS_R_NXDOMAIN is not a valid return value when doing
+        * recursion, we need to patch it.
+        */
+       if (result == DNS_R_NXDOMAIN) {
+               result = DNS_R_SERVFAIL;
+       }
+
        if (result != ISC_R_SUCCESS) {
                fctx_done(fctx, result, __LINE__);
                goto cleanup;