]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEV: tcploop: permit port 0 to ease handling of default options
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Jun 2022 10:06:04 +0000 (12:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 8 Jun 2022 12:42:15 +0000 (14:42 +0200)
This will also be convenient when binding to an IP and no port.

dev/tcploop/tcploop.c

index ca984f79f79c4179a0e4d7eb3ebb1110803ce5b3..1aebb881ef04fc54cc71180433dc3bef66ba7a56 100644 (file)
@@ -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;
                }