goto out;
}
- if (port1 != port2) {
- ha_alert("parsing [%s:%d] : '%s' : port ranges and offsets are not allowed in '%s'.\n",
- file, linenum, args[0], args[1]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
- if (!port1) {
- ha_alert("parsing [%s:%d] : '%s' : missing port number in '%s', <addr:port> expected.\n",
- file, linenum, args[0], args[1]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
goto out;
}
- if (port1 != port2) {
- ha_alert("parsing [%s:%d] : '%s' : port ranges and offsets are not allowed in '%s'\n",
- file, linenum, args[0], args[1]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
curproxy->conn_src.source_addr = *sk;
curproxy->conn_src.opts |= CO_SRC_BIND;
goto out;
}
- if (port1 != port2) {
- ha_alert("parsing [%s:%d] : '%s' : port ranges and offsets are not allowed in '%s'\n",
- file, linenum, args[cur_arg], args[cur_arg + 1]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
curproxy->conn_src.tproxy_addr = *sk;
curproxy->conn_src.opts |= CO_SRC_TPROXY_ADDR;
}
if (!ss2)
goto fail;
- if (ss2->ss_family == AF_INET || ss2->ss_family == AF_INET6
- || ss2->ss_family == AF_CUST_UDP4
- || ss2->ss_family == AF_CUST_UDP6) {
- if (!port && !end) {
- memprintf(err, "missing port number: '%s'\n", str);
- goto fail;
- }
-
- if (!port || !end) {
- memprintf(err, "port offsets are not allowed in 'bind': '%s'\n", str);
- goto fail;
- }
-
- if (port < 1 || port > 65535) {
- memprintf(err, "invalid port '%d' specified for address '%s'.\n", port, str);
- goto fail;
- }
-
- if (end < 1 || end > 65535) {
- memprintf(err, "invalid port '%d' specified for address '%s'.\n", end, str);
- goto fail;
- }
- }
- else if (ss2->ss_family == AF_CUST_EXISTING_FD) {
+ if (ss2->ss_family == AF_CUST_EXISTING_FD) {
socklen_t addr_len;
inherited = 1;
goto out;
}
- if (port1 != port2) {
- ha_alert("parsing [%s:%d] : '%s %s' : port ranges and offsets are not allowed in '%s'\n",
- file, linenum, args[0], args[1], args[2]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
- if (!port1 && !port2) {
- ha_alert("parsing [%s:%d] : '%s %s' : no UDP port specified\n",
- file, linenum, args[0], args[1]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
newnameserver->addr = *sk;
}
else if (strcmp(args[0], "parse-resolv-conf") == 0) {
goto out;
}
- if (port1 != port2) {
- ha_alert("parsing [%s:%d] : '%s %s' : port ranges and offsets are not allowed in '%s'\n",
- file, linenum, args[0], args[1], args[2]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
- if (!port1) {
- ha_alert("parsing [%s:%d] : '%s %s' : missing or invalid port in '%s'\n",
- file, linenum, args[0], args[1], args[2]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
newmailer->addr = *sk;
newmailer->proto = proto;
newmailer->xprt = xprt_get(XPRT_RAW);
goto error;
}
- if (port1 != port2) {
- memprintf(errmsg, "'%s' : port ranges and offsets are not allowed in '%s'.",
- args[*cur_arg], args[*cur_arg+1]);
- goto error;
- }
-
srv->check.addr = srv->agent.addr = *sk;
srv->flags |= SRV_F_CHECKADDR;
srv->flags |= SRV_F_AGENTADDR;
xref_unlock(&socket->xref, peer);
WILL_LJMP(luaL_error(L, "connect: cannot parse destination address '%s'", ip));
}
- if (low != high) {
- xref_unlock(&socket->xref, peer);
- WILL_LJMP(luaL_error(L, "connect: port ranges not supported : address '%s'", ip));
- }
/* Set port. */
if (low == 0) {
sk->ss_family = AF_INET6;
if (sk->ss_family == AF_INET || sk->ss_family == AF_INET6) {
- if (port1 != port2) {
- memprintf(err, "port ranges and offsets are not allowed in '%s'", args[1]);
- goto error;
- }
logsrv->addr = *sk;
if (!port1)
set_host_port(&logsrv->addr, SYSLOG_PORT);
if (port_low != port_high) {
int i;
- if (!port_low || !port_high) {
- ha_alert("'%s' does not support port offsets (found '%s').\n",
- args[*cur_arg], args[*cur_arg + 1]);
- goto err;
- }
-
- if (port_low <= 0 || port_low > 65535 ||
- port_high <= 0 || port_high > 65535 ||
- port_low > port_high) {
- ha_alert("'%s': invalid source port range %d-%d.\n", args[*cur_arg], port_low, port_high);
- goto err;
- }
newsrv->conn_src.sport_range = port_range_alloc_range(port_high - port_low + 1);
for (i = 0; i < newsrv->conn_src.sport_range->size; i++)
newsrv->conn_src.sport_range->ports[i] = port_low + i;
goto err;
}
- if (port1 != port2) {
- ha_alert("'%s' : port ranges and offsets are not allowed in '%s'\n",
- args[*cur_arg], args[*cur_arg + 1]);
- goto err;
- }
newsrv->conn_src.tproxy_addr = *sk;
newsrv->conn_src.opts |= CO_SRC_TPROXY_ADDR;
}
newsrv->flags |= SRV_F_SOCKS4_PROXY;
newsrv->socks4_addr = *sk;
- if (port_low != port_high) {
- ha_alert("'%s' does not support port offsets (found '%s').\n", args[*cur_arg], args[*cur_arg + 1]);
- goto err;
- }
-
- if (port_low <= 0 || port_low > 65535) {
- ha_alert("'%s': invalid port %d.\n", args[*cur_arg], port_low);
- goto err;
- }
-
return 0;
err:
/* no port specified, +offset, -offset */
newsrv->flags |= SRV_F_MAPPORTS;
}
- else if (port1 != port2) {
- /* port range */
- ha_alert("parsing [%s:%d] : '%s %s' : port ranges are not allowed in '%s'\n",
- file, linenum, args[0], args[1], args[2]);
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
/* save hostname and create associated name resolution */
if (fqdn) {
goto error;
}
- if (port1 != port2) {
- memprintf(errmsg, "'%s' : port ranges and offsets are not allowed in '%s'\n",
- args[cur_arg], args[cur_arg+1]);
- goto error;
- }
-
cur_arg++;
}
else if (strcmp(args[cur_arg], "port") == 0) {