From: Evan Hunt Date: Wed, 22 May 2024 20:02:16 +0000 (-0700) Subject: attach query counter to NS fetches X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37212b6e24fad615513fafaa84f1d62b689b3381;p=thirdparty%2Fbind9.git attach query counter to NS fetches there were cases in resolver.c when queries for NS records were started without passing a pointer to the parent fetch's query counter; as a result, the max-recursion-queries quota for those queries started counting from zero, instead of sharing the limit for the parent fetch, making the quota ineffective in some cases. (cherry picked from commit d3b7e92783754e9a4ce93046fadcb96c5439a0d7) (cherry picked from commit 5ab4cae4ed5c2f7b8509a0dfcbadbc727abecf36) --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 312004ff58d..9c605a85030 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -7728,10 +7728,10 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { FCTXTRACE("continuing to look for parent's NS records"); - result = dns_resolver_createfetch(fctx->res, &fctx->nsname, + result = dns_resolver_createfetch3(fctx->res, &fctx->nsname, dns_rdatatype_ns, domain, - nsrdataset, NULL, - fctx->options, task, + nsrdataset, NULL, NULL, 0, + fctx->options, 0, NULL, task, resume_dslookup, fctx, &fctx->nsrrset, NULL, &fctx->nsfetch); @@ -9026,10 +9026,10 @@ resquery_response(isc_task_t *task, isc_event_t *event) { FCTXTRACE("suspending DS lookup to find parent's NS records"); - result = dns_resolver_createfetch(res, &fctx->nsname, + result = dns_resolver_createfetch3(res, &fctx->nsname, dns_rdatatype_ns, - NULL, NULL, NULL, - fctx->options, task, + NULL, NULL, NULL, NULL, 0, + fctx->options, 0, NULL, task, resume_dslookup, fctx, &fctx->nsrrset, NULL, &fctx->nsfetch); @@ -9532,11 +9532,11 @@ dns_resolver_prime(dns_resolver_t *res) { } dns_rdataset_init(rdataset); LOCK(&res->primelock); - result = dns_resolver_createfetch(res, dns_rootname, + result = dns_resolver_createfetch3(res, dns_rootname, dns_rdatatype_ns, - NULL, NULL, NULL, + NULL, NULL, NULL, NULL, 0, DNS_FETCHOPT_NOFORWARD, - res->buckets[0].task, + 0, NULL, res->buckets[0].task, prime_done, res, rdataset, NULL, &res->primefetch);