From f67be93ae0caa8de538b5e2ac6fa1eef90e3f9cd Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Tue, 29 Jan 2019 15:47:43 +0100 Subject: [PATCH] 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. --- src/checks.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/checks.c b/src/checks.c index b0de770..78d4e39 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; -- 1.7.10.4