]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
prevent query_coveringnsec() from running twice
authorEvan Hunt <each@isc.org>
Fri, 19 May 2023 05:02:06 +0000 (22:02 -0700)
committerEvan Hunt <each@isc.org>
Mon, 21 Aug 2023 21:37:00 +0000 (14:37 -0700)
when synthesizing a new CNAME, we now check whether the target
matches the query already being processed. if so, we do not
restart the query; this prevents a waste of resources.

(cherry picked from commit 0ae8b2e056c3e24df0746541c505bc358352f7fa)

lib/ns/query.c

index 5cf502eef006ffce4a90c8f834579371fe3ab208..4503b8d9fe16b9f6c75ce31d29086ad91dbca78a 100644 (file)
@@ -9651,6 +9651,12 @@ query_synthcnamewildcard(query_ctx_t *qctx, dns_rdataset_t *rdataset,
        RUNTIME_CHECK(result == ISC_R_SUCCESS);
        dns_rdata_reset(&rdata);
 
+       if (dns_name_equal(qctx->client->query.qname, &cname.cname)) {
+               dns_message_puttempname(qctx->client->message, &tname);
+               dns_rdata_freestruct(&cname);
+               return (ISC_R_SUCCESS);
+       }
+
        dns_name_copynf(&cname.cname, tname);
 
        dns_rdata_freestruct(&cname);