aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/conf.c b/conf.c
index e5baf8e..dc9468c 100644
--- a/conf.c
+++ b/conf.c
@@ -151,10 +151,7 @@ static void conf_ports_range_except(const struct ctx *c, char optname,
unsigned base, i;
uint8_t proto;
- if (first == 0) {
- die("Can't forward port 0 for option '-%c %s'",
- optname, optarg);
- }
+ assert(first != 0);
if (optname == 't' || optname == 'T')
proto = IPPROTO_TCP;
@@ -404,6 +401,11 @@ static void conf_ports(const struct ctx *c, char optname, const char *optarg,
if ((*p != '\0') && (*p != ',')) /* Garbage after the ranges */
goto bad;
+ if (orig_range.first == 0) {
+ die("Can't forward port 0 for option '-%c %s'",
+ optname, optarg);
+ }
+
conf_ports_range_except(c, optname, optarg, fwd,
addr, ifname,
orig_range.first, orig_range.last,