]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: checks: only complain about the missing port when the check uses TCP
authorWilly Tarreau <w@1wt.eu>
Fri, 9 May 2014 21:59:19 +0000 (23:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 May 2014 23:26:38 +0000 (01:26 +0200)
For UNIX socket addresses, we don't need any port, so let's disable the
check under this condition.

src/server.c

index 9fa69f2415a447c452cedcc1976689567d1aab1a..190168641f24766b45690c20328b124ba5098a6b 100644 (file)
@@ -1072,9 +1072,11 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
                        }
                        /*
                         * We need at least a service port, a check port or the first tcp-check rule must
-                        * be a 'connect' one
+                        * be a 'connect' one when checking an IPv4/IPv6 server.
                         */
-                       if (!newsrv->check.port) {
+                       if (!newsrv->check.port &&
+                           (is_inet_addr(&newsrv->check_common.addr) ||
+                            (!is_addr(&newsrv->check_common.addr) && is_inet_addr(&newsrv->addr)))) {
                                struct tcpcheck_rule *n = NULL, *r = NULL;
                                struct list *l;