]> 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 19:22:47 +0000 (12:22 -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.

lib/ns/query.c

index 8edfc9814ceafef3790b162d12d6a7bad8e7753c..0b3d359d17ad4eba2f832ac1645dec5ad841c9bf 100644 (file)
@@ -9870,6 +9870,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_copy(&cname.cname, tname);
 
        dns_rdata_freestruct(&cname);