]> 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)
committerOndřej Surý <ondrej@isc.org>
Tue, 20 Aug 2024 17:35:07 +0000 (17:35 +0000)
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)

lib/dns/resolver.c

index 4c621329b87eb9abc00f259eed9b25e2b4e0f598..5dce41a98f5f0b7f2afb929183b1af43dfc3a146 100644 (file)
@@ -7734,7 +7734,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
                options = fctx->options & ~DNS_FETCHOPT_TRYSTALE_ONTIMEOUT;
                result = dns_resolver_createfetch(
                        fctx->res, &fctx->nsname, dns_rdatatype_ns, domain,
-                       nsrdataset, NULL, NULL, 0, options, 0, NULL, task,
+                       nsrdataset, NULL, NULL, 0, options, 0, fctx->qc, task,
                        resume_dslookup, fctx, &fctx->nsrrset, NULL,
                        &fctx->nsfetch);
                /*
@@ -10076,8 +10076,8 @@ 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, rctx->task, resume_dslookup, fctx,
-               &fctx->nsrrset, NULL, &fctx->nsfetch);
+               NULL, 0, options, 0, fctx->qc, rctx->task, resume_dslookup,
+               fctx, &fctx->nsrrset, NULL, &fctx->nsfetch);
        if (result != ISC_R_SUCCESS) {
                if (result == DNS_R_DUPLICATE) {
                        result = DNS_R_SERVFAIL;