From 2f3a56b4ff207de37bdd944993a88bca781ad243 Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Mon, 19 Mar 2018 12:22:41 +0100 Subject: [PATCH] BUG/MINOR: tcp-check: use the server's service port as a fallback When running tcp-check scripts, one must ensure we can establish a tcp connection first. When doing this action, HAProxy needs a TCP port configured either on the server or on the check itself or on the connect rule itself. For some reasons, the connect code did not evaluate the service port on the server structure... this patch fixes this error. Backport status: 1.8 --- src/checks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/checks.c b/src/checks.c index 8ca2089546..cae2e3e3fa 100644 --- a/src/checks.c +++ b/src/checks.c @@ -2757,6 +2757,8 @@ static int tcpcheck_main(struct check *check) set_host_port(&conn->addr.to, check->current_step->port); else if (check->port) set_host_port(&conn->addr.to, check->port); + else if (s->svc_port) + set_host_port(&conn->addr.to, s->svc_port); if (check->current_step->conn_opts & TCPCHK_OPT_SSL) { xprt = xprt_get(XPRT_SSL); -- 2.39.5