]> 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)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 3 Apr 2023 15:21:43 +0000 (15:21 +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.

lib/dns/request.c

index 5cb7c7d263af031a64a24bac2360b81d232e0128..3c1bda28db81a777c839a1510678b5967d3d4419 100644 (file)
@@ -976,7 +976,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);