[9.18] fix: dig - always set the default port when doing a UDP query

This change 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.

Backport of !9618.

Merge branch 'artem-debian-bug-1059582-9.18' into 'bind-9.18'

See merge request isc-projects/bind9!9620
This commit is contained in:
Artem Boldariev
2024-10-10 20:08:04 +00:00

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. */