From 5ab4cae4ed5c2f7b8509a0dfcbadbc727abecf36 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 22 May 2024 13:02:16 -0700 Subject: [PATCH] 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) --- lib/dns/resolver.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 70ede1d515..0b22397ad5 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -7567,8 +7567,9 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) { options = fctx->options & ~DNS_FETCHOPT_TRYSTALE_ONTIMEOUT; result = dns_resolver_createfetch( res, fctx->nsname, dns_rdatatype_ns, domain, nsrdataset, - NULL, NULL, 0, options, 0, NULL, task, resume_dslookup, - fctx, &fctx->nsrrset, NULL, &fctx->nsfetch); + NULL, NULL, 0, options, 0, fctx->qc, task, + resume_dslookup, fctx, &fctx->nsrrset, NULL, + &fctx->nsfetch); if (result != ISC_R_SUCCESS) { if (result == DNS_R_DUPLICATE) { result = DNS_R_SERVFAIL; @@ -9934,7 +9935,7 @@ rctx_chaseds(respctx_t *rctx, dns_message_t *message, options = fctx->options & ~DNS_FETCHOPT_TRYSTALE_ONTIMEOUT; result = dns_resolver_createfetch( fctx->res, fctx->nsname, dns_rdatatype_ns, NULL, NULL, NULL, - NULL, 0, options, 0, NULL, task, resume_dslookup, fctx, + NULL, 0, options, 0, fctx->qc, task, resume_dslookup, fctx, &fctx->nsrrset, NULL, &fctx->nsfetch); if (result != ISC_R_SUCCESS) { if (result == DNS_R_DUPLICATE) {