From: Evan Hunt Date: Fri, 19 May 2023 05:02:06 +0000 (-0700) Subject: prevent query_coveringnsec() from running twice X-Git-Tag: v9.16.44~8^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=674a62694a72e49cf999a0f4a3564d5f3bcbe599;p=thirdparty%2Fbind9.git 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. (cherry picked from commit 0ae8b2e056c3e24df0746541c505bc358352f7fa) --- diff --git a/lib/ns/query.c b/lib/ns/query.c index 5cf502eef00..4503b8d9fe1 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -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);