From: Aram Sargsyan Date: Mon, 12 Dec 2022 12:12:13 +0000 (+0000) Subject: Do not resend TCP requests X-Git-Tag: v9.19.12~25^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edcdb881da9aefaaadb9b6e4de2ff372ed395ab0;p=thirdparty%2Fbind9.git Do not resend TCP requests 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. --- diff --git a/lib/dns/request.c b/lib/dns/request.c index 5cb7c7d263a..3c1bda28db8 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -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);