From: Willy Tarreau Date: Tue, 7 Jun 2022 10:06:04 +0000 (+0200) Subject: DEV: tcploop: permit port 0 to ease handling of default options X-Git-Tag: v2.7-dev1~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb284c7a62ff57eb5d05eed8da300c3b3b8961b8;p=thirdparty%2Fhaproxy.git DEV: tcploop: permit port 0 to ease handling of default options This will also be convenient when binding to an IP and no port. --- diff --git a/dev/tcploop/tcploop.c b/dev/tcploop/tcploop.c index ca984f79f7..1aebb881ef 100644 --- a/dev/tcploop/tcploop.c +++ b/dev/tcploop/tcploop.c @@ -248,7 +248,7 @@ int addr_to_ss(const char *str, struct sockaddr_storage *ss, struct err_msg *err */ if ((port_str = strrchr(str, ':')) == NULL) { port = atoi(str); - if (port <= 0 || port > 65535) { + if (port < 0 || port > 65535) { err->len = snprintf(err->msg, err->size, "Missing/invalid port number: '%s'\n", str); return -1; }