From: Olivier Houchard Date: Tue, 29 Jan 2019 14:47:43 +0000 (+0100) Subject: BUG/MEDIUM: checks: Check that conn_install_mux succeeded. X-Git-Tag: v2.0-dev1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f67be93ae0caa8de538b5e2ac6fa1eef90e3f9cd;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: checks: Check that conn_install_mux succeeded. If conn_install_mux failed, then the connection has no mux and won't be usable, so just give up is on failure instead of ignoring it. This should be backported to 1.9. --- diff --git a/src/checks.c b/src/checks.c index b0de770887..78d4e390b6 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1625,7 +1625,8 @@ static int connect_conn_chk(struct task *t) clear_addr(&conn->addr.from); conn_prepare(conn, proto, check->xprt); - conn_install_mux(conn, &mux_pt_ops, cs, s->proxy, NULL); + if (conn_install_mux(conn, &mux_pt_ops, cs, s->proxy, NULL) < 0) + return SF_ERR_RESOURCE; cs_attach(cs, check, &check_conn_cb); /* only plain tcp-check supports quick ACK */ @@ -2818,7 +2819,8 @@ static int tcpcheck_main(struct check *check) } conn_prepare(conn, proto, xprt); - conn_install_mux(conn, &mux_pt_ops, cs, proxy, NULL); + if (conn_install_mux(conn, &mux_pt_ops, cs, proxy, NULL) < 0) + return SF_ERR_RESOURCE; cs_attach(cs, check, &check_conn_cb); ret = SF_ERR_INTERNAL;