]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Do not resend TCP requests
authorAram Sargsyan <aram@isc.org>
Mon, 12 Dec 2022 12:12:13 +0000 (12:12 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 3 Apr 2023 16:18:39 +0000 (16:18 +0000)
The req_response() function is using 'udpcount' variable to resend
the request 'udpcount' times on timeout even for TCP requests,
which does not make sense, as it would use the same connection.

Add a condition to use the resend logic only for UDP requests.

(cherry picked from commit edcdb881da9aefaaadb9b6e4de2ff372ed395ab0)

lib/dns/request.c

index 8f53d3781266d32463ae2ac3159f9fe145d1b0d7..b2b7b119b990554e4f1736555be10406331c5fb0 100644 (file)
@@ -1061,7 +1061,9 @@ req_response(isc_result_t result, isc_region_t *region, void *arg) {
 
        if (result == ISC_R_TIMEDOUT) {
                LOCK(&request->requestmgr->locks[request->hash]);
-               if (request->udpcount > 1) {
+               if (request->udpcount > 1 &&
+                   (request->flags & DNS_REQUEST_F_TCP) == 0)
+               {
                        request->udpcount -= 1;
                        dns_dispatch_resume(request->dispentry,
                                            request->timeout);