[9.20] 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.20' into 'bind-9.20'

See merge request isc-projects/bind9!9619
This commit is contained in:
Artem Boldariev 2024-10-10 19:56:47 +00:00
commit 9aab8cb150

View file

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