]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries
authorOndřej Surý <ondrej@sury.org>
Sun, 13 Oct 2019 14:33:22 +0000 (16:33 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 18 Nov 2019 19:48:32 +0000 (03:48 +0800)
The dns_adb_beginudpfetch() is called only for UDP queries, but
the dns_adb_endudpfetch() is called for all queries, including
TCP.  This messages the quota counting in adb.c.

(cherry picked from commit a5189eefa5c17654ebeab77ed1ff8746bcc9d99f)

lib/dns/resolver.c

index 77d8ef6744568c556b1a767f23c197a476e605ae..db0575d8fcfb6fdafa7367ff626ff51324bfc43e 100644 (file)
@@ -1277,7 +1277,10 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
 
                dns_adb_adjustsrtt(fctx->adb, query->addrinfo, rtt, factor);
        }
-       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);
+       }
 
        /*
         * Age RTTs of servers not tried.
@@ -2140,7 +2143,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
                if (dns_adbentry_overquota(addrinfo->entry))
                        goto cleanup_dispatch;
 
-               /* Inform the ADB that we're starting a fetch */
+               /* Inform the ADB that we're starting a UDP fetch */
                dns_adb_beginudpfetch(fctx->adb, addrinfo);
 
                result = resquery_send(query);