]> 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:34:46 +0000 (17:34 +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 312004ff58db55488802b82b8a4edc55ffe6b9d8..9c605a85030a61ffa569cfd271b57f5b6805094a 100644 (file)
@@ -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);