]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Move the mapping of SIG and RRSIG to ANY
authorMark Andrews <marka@isc.org>
Thu, 27 Oct 2022 02:22:11 +0000 (13:22 +1100)
committerMichał Kępień <michal@isc.org>
Thu, 12 Jan 2023 11:33:28 +0000 (12:33 +0100)
dns_db_findext() asserts if RRSIG is passed to it and
query_lookup_stale() failed to map RRSIG to ANY to prevent this.  To
avoid cases like this in the future, move the mapping of SIG and RRSIG
to ANY for qctx->type to qctx_init().

(cherry picked from commit 56eae064183488bcf7ff08c3edf59f2e1742c1b6)

lib/ns/query.c

index 9ca353e795f7ff5e034603567aa3519d47b0f048..348aee8b3f657938d020e1b1e5c5f47b7aa5485c 100644 (file)
@@ -5177,6 +5177,15 @@ qctx_init(ns_client_t *client, dns_fetchevent_t **eventp, dns_rdatatype_t qtype,
        qctx->result = ISC_R_SUCCESS;
        qctx->findcoveringnsec = qctx->view->synthfromdnssec;
 
+       /*
+        * If it's an RRSIG or SIG query, we'll iterate the node.
+        */
+       if (qctx->qtype == dns_rdatatype_rrsig ||
+           qctx->qtype == dns_rdatatype_sig)
+       {
+               qctx->type = dns_rdatatype_any;
+       }
+
        CALL_HOOK_NORETURN(NS_QUERY_QCTX_INITIALIZED, qctx);
 }
 
@@ -5318,15 +5327,6 @@ query_setup(ns_client_t *client, dns_rdatatype_t qtype) {
 
        CALL_HOOK(NS_QUERY_SETUP, &qctx);
 
-       /*
-        * If it's a SIG query, we'll iterate the node.
-        */
-       if (qctx.qtype == dns_rdatatype_rrsig ||
-           qctx.qtype == dns_rdatatype_sig)
-       {
-               qctx.type = dns_rdatatype_any;
-       }
-
        /*
         * Check SERVFAIL cache
         */