From: Christopher Faulet Date: Mon, 26 Oct 2020 10:10:49 +0000 (+0100) Subject: BUG/MINOR: checks: Report a socket error before any connection attempt X-Git-Tag: v2.3.0~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e29376efb5009af731407adb4051f300786b620;p=thirdparty%2Fhaproxy.git BUG/MINOR: checks: Report a socket error before any connection attempt When a health-check fails, if no connection attempt was performed, a socket error must be reported. But this was only done if the connection was not allocated. It must also be done if there is no control layer. Otherwise, a L7TOUT will be reported instead. It is possible to not having a control layer for a connection if the connection address family is invalid or not defined. This patch must be backported to 2.2. --- diff --git a/src/check.c b/src/check.c index 88c78ed622..c281bb2793 100644 --- a/src/check.c +++ b/src/check.c @@ -655,8 +655,8 @@ void chk_report_conn_err(struct check *check, int errno_bck, int expired) set_server_check_status(check, HCHK_STATUS_SOCKERR, err_msg); } - if (!conn) { - /* connection allocation error before the connection was established */ + if (!conn || !conn->ctrl) { + /* error before any connection attempt (connection allocation error or no control layer) */ set_server_check_status(check, HCHK_STATUS_SOCKERR, err_msg); } else if (conn->flags & CO_FL_WAIT_L4_CONN) {