]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Always call dns_adb_endudpfetch() in fctx_cancelquery() for UDP queries
authorAram Sargsyan <aram@isc.org>
Fri, 21 Oct 2022 08:08:47 +0000 (08:08 +0000)
committerAram Sargsyan <aram@isc.org>
Fri, 21 Oct 2022 08:36:34 +0000 (08:36 +0000)
It is currently possible that dns_adb_endudpfetch() is not
called in fctx_cancelquery() for a UDP query, which results
in quotas not being adjusted back.

Always call dns_adb_endudpfetch() for UDP queries.

(cherry picked from commit e4569373ca05e2e1c1c04d2b81c1b592acf927e5)

lib/dns/resolver.c

index e136a74266ffbbd346c57eee9327b776e5abc5d5..6e030b17b8fa5debe4e437b0fba97767d4ce120a 100644 (file)
@@ -1422,11 +1422,11 @@ fctx_cancelquery(resquery_t **queryp, isc_time_t *finish, bool no_response,
                }
 
                dns_adb_adjustsrtt(fctx->adb, query->addrinfo, rtt, factor);
+       }
 
-               if ((query->options & DNS_FETCHOPT_TCP) == 0) {
-                       /* Inform the ADB that we're ending a UDP fetch */
-                       dns_adb_endudpfetch(fctx->adb, query->addrinfo);
-               }
+       if ((query->options & DNS_FETCHOPT_TCP) == 0) {
+               /* Inform the ADB that we're ending a UDP fetch */
+               dns_adb_endudpfetch(fctx->adb, query->addrinfo);
        }
 
        /*