MINOR: tools: make str2sa_range() return the port in a separate argument
This will be needed so that we're don't have to extract it from the
returned address where it will not always be anymore (eg: for unresolved
servers).
diff --git a/src/server.c b/src/server.c
index 8aaf218..cc76317 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1005,7 +1005,7 @@
* - IP:+N => port=+N, relative
* - IP:-N => port=-N, relative
*/
- sk = str2sa_range(args[2], &port1, &port2, &errmsg, NULL, &fqdn, 0);
+ sk = str2sa_range(args[2], NULL, &port1, &port2, &errmsg, NULL, &fqdn, 0);
if (!sk) {
Alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
@@ -1391,7 +1391,7 @@
int port1, port2;
struct protocol *proto;
- sk = str2sa_range(args[cur_arg + 1], &port1, &port2, &errmsg, NULL, NULL, 1);
+ sk = str2sa_range(args[cur_arg + 1], NULL, &port1, &port2, &errmsg, NULL, NULL, 1);
if (!sk) {
Alert("parsing [%s:%d] : '%s' : %s\n",
file, linenum, args[cur_arg], errmsg);
@@ -1603,7 +1603,7 @@
}
newsrv->conn_src.opts |= CO_SRC_BIND;
- sk = str2sa_range(args[cur_arg + 1], &port_low, &port_high, &errmsg, NULL, NULL, 1);
+ sk = str2sa_range(args[cur_arg + 1], NULL, &port_low, &port_high, &errmsg, NULL, NULL, 1);
if (!sk) {
Alert("parsing [%s:%d] : '%s %s' : %s\n",
file, linenum, args[cur_arg], args[cur_arg+1], errmsg);
@@ -1703,7 +1703,7 @@
struct sockaddr_storage *sk;
int port1, port2;
- sk = str2sa_range(args[cur_arg + 1], &port1, &port2, &errmsg, NULL, NULL, 1);
+ sk = str2sa_range(args[cur_arg + 1], NULL, &port1, &port2, &errmsg, NULL, NULL, 1);
if (!sk) {
Alert("parsing [%s:%d] : '%s %s' : %s\n",
file, linenum, args[cur_arg], args[cur_arg+1], errmsg);