From: Willy Tarreau Date: Fri, 15 May 2026 05:20:48 +0000 (+0000) Subject: BUG/MINOR: servers: use proper source of pool_conn_name in srv_settings_cpy() X-Git-Tag: v3.4-dev13~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b468a08200f1af0293bb0d6da94e53570281fe8;p=thirdparty%2Fhaproxy.git BUG/MINOR: servers: use proper source of pool_conn_name in srv_settings_cpy() The condition 'if (srv->pool_conn_name)' was checking the destination instead of the source 'src->pool_conn_name', meaning the strdup() would never fire (since newly calloc'd servers start with NULL pool_conn_name), and the pool_conn_name setting from default-server was silently ignored. Introduced in 3.2 with commit f0f1816f1 ("MINOR: check: implement check-pool-conn-name srv keyword") when pool_conn_name support was added to srv_settings_cpy(). The bug caused any 'pool-conn-name' setting in a 'default-server' line to be lost for all servers inheriting from it. Note that it's not the first time this function induces such a bug due to the poor choice of "srv" vs "src" that should be renamed to avoid keyboard mistakes and visual confusion. This needs to be backported to 3.2. --- diff --git a/src/server.c b/src/server.c index ff2ebcfb5..df87e7476 100644 --- a/src/server.c +++ b/src/server.c @@ -3055,8 +3055,8 @@ void srv_settings_cpy(struct server *srv, const struct server *src, int srv_tmpl srv->tcp_ut = src->tcp_ut; #endif srv->mux_proto = src->mux_proto; - if (srv->pool_conn_name) - srv->pool_conn_name = strdup(srv->pool_conn_name); + if (src->pool_conn_name) + srv->pool_conn_name = strdup(src->pool_conn_name); srv->pool_purge_delay = src->pool_purge_delay; srv->low_idle_conns = src->low_idle_conns; srv->max_idle_conns = src->max_idle_conns;