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
This commit is contained in:
Ondřej Surý 2026-05-16 13:24:53 +02:00
parent db28b2127a
commit 08295d004e
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41

View 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);