From: Christopher Faulet Date: Tue, 1 Sep 2026 15:51:07 +0000 (+0200) Subject: BUG/MEDIUM: resolvers: Use the right server to init DNS streams X-Git-Tag: v3.5-dev6~26 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=15a436ba2885320169dce05eef1df8a04f91c2c5;p=haproxy.git BUG/MEDIUM: resolvers: Use the right server to init DNS streams During TCP nameservers parsing, the wrong server was selected to initialize the DNS stream. After the server addition, the first server of the proxy was selected instead of the last one. So when several TCP nameservers was defined, only the first one was properly initialized. All others was using the server created for the first one. The regression was introduced when the server insertion in the proxy's list was inverted. The change was not made on the resolvers part. The proxy_last_server() function must be used instead. It is a 3.5-specific issue. No backported needed. --- diff --git a/src/resolvers.c b/src/resolvers.c index 06fb19c41..b4812f3a0 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -3803,7 +3803,7 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) goto out; } - if (dns_stream_init(newnameserver, proxy_first_server(curr_resolvers->px)) < 0) { + if (dns_stream_init(newnameserver, proxy_last_server(curr_resolvers->px)) < 0) { ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum); err_code |= ERR_ALERT|ERR_ABORT; free(newnameserver);