From 0ae8b2e056c3e24df0746541c505bc358352f7fa Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Thu, 18 May 2023 22:02:06 -0700 Subject: [PATCH] prevent query_coveringnsec() from running twice 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ns/query.c b/lib/ns/query.c index 8edfc9814c..0b3d359d17 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -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);