From 08295d004ee9bdfc8fb8e59aa124e7874ae7b23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Sat, 16 May 2026 13:24:53 +0200 Subject: [PATCH] Skip EDNS UDP-size hint on TCP retries 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 0fc89804b8..7095143dd3 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -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);