]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: check: properly report errno in chk_report_conn_err()
authorWilly Tarreau <w@1wt.eu>
Mon, 18 May 2026 15:07:20 +0000 (17:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 18 May 2026 16:40:37 +0000 (18:40 +0200)
commit3b825d2745574ae4430ff385f5ae801ceec784e1
tree154567479a4a5e0fa2e942a696db4a5b9efa859d
parent3da2b63274a6de73abf2392b7703ceb5a58ddbac
BUG/MINOR: check: properly report errno in chk_report_conn_err()

When in 2.2, with commit c8dc20a825 ("BUG/MINOR: checks: refine which
errno values are really errors."), errno reporting was refined, an
extra check was added before calling retrieve_errno_from_socket(), and
by mistake the test on !errno got inverted so that we only call the
function to retrieve the error from the socket when errno is set!
The first test in the function detects it and returns without changing
anything, so this didn't have much effect, however when errno is not
set (certain call places purposely pass zero so that getsockopt() is
used), this wasn't called so the error wasn't reported. Apparently it
only happened when called from process_chk_conn() after an async
error was detected, so probably just cases where POLLERR is reported,
which remains infrequent.

Let's fix the direction of this flag. It can be backported if needed
but it's unlikely anyone really noticed.
src/check.c