]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Skip EDNS UDP-size hint on TCP retries
authorOndřej Surý <ondrej@isc.org>
Sat, 16 May 2026 11:24:53 +0000 (13:24 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 19 May 2026 09:18:30 +0000 (11:18 +0200)
The hint feeds the EDNS OPT UDP-size field, which has no effect on TCP
transport.  Avoid the dns_adb_getudpsize() lookup when the query is
already pinned to TCP.

Assisted-by: Claude:claude-opus-4-7
lib/dns/resolver.c

index 0fc89804b80028af26c422fde275595006b9e4f9..7095143dd3a4ad0cb62a6f309e74496abfba3305 100644 (file)
@@ -2571,7 +2571,9 @@ resquery_send(resquery_t *query) {
                query->options |= DNS_FETCHOPT_NOEDNS0;
        }
 
-       if (fctx->timeout && (query->options & DNS_FETCHOPT_NOEDNS0) == 0) {
+       if (fctx->timeout && (query->options & DNS_FETCHOPT_NOEDNS0) == 0 &&
+           (query->options & DNS_FETCHOPT_TCP) == 0)
+       {
                isc_sockaddr_t *sockaddr = &query->addrinfo->sockaddr;
                struct tried *tried = triededns(fctx, sockaddr);