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.

(cherry picked from commit e390ed4421)
This commit is contained in:
Artem Boldariev
2024-10-10 13:18:05 +03:00
parent 03b5bde1d4
commit cecd3a75ec

View File

@@ -3308,6 +3308,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. */