From: Willy Tarreau Date: Fri, 9 May 2014 21:59:19 +0000 (+0200) Subject: MEDIUM: checks: only complain about the missing port when the check uses TCP X-Git-Tag: v1.5-dev25~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5cf0b52d291c81d3a6b2a3082f4ee7845e75e635;p=thirdparty%2Fhaproxy.git MEDIUM: checks: only complain about the missing port when the check uses TCP For UNIX socket addresses, we don't need any port, so let's disable the check under this condition. --- diff --git a/src/server.c b/src/server.c index 9fa69f2415..190168641f 100644 --- a/src/server.c +++ b/src/server.c @@ -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;