]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: server: dont return immediately from parse_server() when skipping checks
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 7 Mar 2025 08:11:21 +0000 (09:11 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 7 Mar 2025 08:39:46 +0000 (09:39 +0100)
commita76b5358f0400568b641dc373cbd582875cd6aa6
tree9b39434c648927317e0e8ebe5a4dc2f64d58a0af
parent054443dfb908521e30aa57335dbcb5f9cd6f7218
BUG/MINOR: server: dont return immediately from parse_server() when skipping checks

If parse_server() is called under peers section parser, and the address
needs to be parsed but it is missing, we directly return from the function

However since 0fc136ce5b ("REORG: server: use parsing ctx for server
parsing"), parse_server() uses parsing ctx to emit warning/errors, and
the ctx must be reset before returning from the function, yet this early
return was overlooked. Because of that, any ha_{warning,alert..} message
reported after early return from parse_server() could cause messages to
have an extra "parsing [file:line]" info.

We fix that by ensuring parse_server() doesn't return without resetting
the parsing context.

It should be backported up to 2.6
src/server.c