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
diff --git a/src/checks.c b/src/checks.c
index 8ca2089..cae2e3e 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -2757,6 +2757,8 @@
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);