MINOR: cfgparse/peers: provide more info when ignoring invalid "peer" or "server...
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 7 Mar 2025 08:30:47 +0000 (09:30 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 15:38:09 +0000 (16:38 +0100)
commitd54c7b8618a906999639778269bcf6044fc9f8bd
tree07e1f6cc17a6fa1bcf1f34ecaba98678f52bd4b2
parent413d3fc5c480d331a99bcb720ee3ec5739ad7cc8
MINOR: cfgparse/peers: provide more info when ignoring invalid "peer" or "server" lines

Invalid (incomplete) "server" or "peer" lines under peers section are now
properly ignored. For completeness, in this patch we add some reports so
that the user knows that incomplete lines were ignored.

For an incomplete server line, since it is tolerated (see GH #565), we
only emit a diag warning.

For an incomplete peer line, we report a real warning, as it is not
expected to have a peer line without an address:port specified.

Also, 'newpeer == curpeers->local' check could be simplified since
we already have the 'local_peer' variable which tells us that the
parsed line refers to a local peer.

(cherry picked from commit dbb25720dd7157e0f180d17486f10340f80a9fda)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 27a92cffb34d534c91e6b9deee886102f4b57b6c)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
src/cfgparse.c