]> 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 18:21:44 +0000 (11:21 -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.

lib/dns/resolver.c

index a2fd672d795f1cbd7436d1fe5b74bc72907337a2..ee85b1e0170385f4f9ba25a284230ffc93bef771 100644 (file)
@@ -7128,7 +7128,7 @@ resume_dslookup(void *arg) {
                fetchctx_ref(fctx);
                result = dns_resolver_createfetch(
                        res, fctx->nsname, dns_rdatatype_ns, domain, nsrdataset,
-                       NULL, NULL, 0, fctx->options, 0, NULL, loop,
+                       NULL, NULL, 0, fctx->options, 0, fctx->qc, loop,
                        resume_dslookup, fctx, &fctx->nsrrset, NULL,
                        &fctx->nsfetch);
                if (result != ISC_R_SUCCESS) {
@@ -9556,8 +9556,8 @@ rctx_chaseds(respctx_t *rctx, dns_message_t *message,
        fetchctx_ref(fctx);
        result = dns_resolver_createfetch(
                fctx->res, fctx->nsname, dns_rdatatype_ns, NULL, NULL, NULL,
-               NULL, 0, fctx->options, 0, NULL, fctx->loop, resume_dslookup,
-               fctx, &fctx->nsrrset, NULL, &fctx->nsfetch);
+               NULL, 0, fctx->options, 0, fctx->qc, fctx->loop,
+               resume_dslookup, fctx, &fctx->nsrrset, NULL, &fctx->nsfetch);
        if (result != ISC_R_SUCCESS) {
                if (result == DNS_R_DUPLICATE) {
                        result = DNS_R_SERVFAIL;