]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: cfgparse-listen: do not emit extraneous line in rule order warnings
authorWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 07:32:41 +0000 (09:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 07:32:41 +0000 (09:32 +0200)
commit3df1fbc6b9ed2cfcb272e2c5162e79c0ad0174d9
treea8e5e7fc1cdbddf60c2fd27870f917a86b1b24c0
parent87a4f6d47ea718087d8057c234299e4d06bffe51
BUG/MINOR: cfgparse-listen: do not emit extraneous line in rule order warnings

Some functions such as tcp_parse_tcp_req() are able to emit their own
warnings by relying on warnif_misplaced_*() which directly prints the
warning. However when doing so they still increment the warning counter
which makes cfg_parse_listen() try to emit it, except that what's in the
variable is NULL, so we end up with:

  [WARNING]  (260) : config : parsing [/etc/haproxy/haproxy.cfg:17] : (null)

Let's just check the errmsg variable before printing the error. If it's
NULL, it's because the message was already printed.

This can be backported to all branches.
src/cfgparse-listen.c