From 6cd9e4f67c48ce9178600aba7fe91266b914e713 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Wed, 5 Mar 2025 09:58:32 +0000 Subject: [PATCH] Fix a bug in get_request_transport_type() When dns_remote_done() is true, calling dns_remote_curraddr() asserts. Add a dns_remote_curraddr() check before calling dns_remote_curraddr(). --- lib/dns/zone.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 536c8f3752..b1c0f5d8a0 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -18461,7 +18461,9 @@ get_request_transport_type(dns_zone_t *zone) { : DNS_TRANSPORT_UDP; /* Check if the peer is forced to always use TCP. */ - if (transport_type != DNS_TRANSPORT_TCP) { + if (transport_type != DNS_TRANSPORT_TCP && + !dns_remote_done(&zone->primaries)) + { isc_result_t result; isc_sockaddr_t primaryaddr; isc_netaddr_t primaryip;