DEV: tcploop: permit port 0 to ease handling of default options

This will also be convenient when binding to an IP and no port.
This commit is contained in:
Willy Tarreau 2022-06-07 12:06:04 +02:00
parent ff13dadaa5
commit cb284c7a62

View 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;
}