From e390ed4421c848077afabc084f731a244316016e Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Thu, 10 Oct 2024 13:18:05 +0300 Subject: [PATCH] dig: always set the default port when doing a UDP query This commit ensures that the port is set before attempting a UDP query. Before that a situation could appear when previous query have completed over a different transport (that uses a dedicated port) and then a UDP query will be attempted over the port of the previous transport. --- bin/dig/dighost.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 27a216490e..ed6ce78c97 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -3278,6 +3278,10 @@ start_udp(dig_query_t *query) { return; } + if (!port_set) { + port = 53; + } + result = get_address(query->servname, port, &query->sockaddr); if (result != ISC_R_SUCCESS) { /* This servname doesn't have an address. */