]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
attach query counter to NS fetches
authorEvan Hunt <each@isc.org>
Wed, 22 May 2024 20:02:16 +0000 (13:02 -0700)
committerEvan Hunt <each@isc.org>
Wed, 7 Aug 2024 21:51:44 +0000 (14:51 -0700)
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

index 70ede1d5155326e0d7215827e211da2460721669..0b22397ad5178fda2c4352502f7ef5ba9dbea573 100644 (file)
@@ -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) {