]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
REDIRECT does not accept IP (Phil Oester <kernel@linuxace.com>)
authorPhil Oester <kernel@linuxace.com>
Tue, 20 Jun 2006 13:45:38 +0000 (13:45 +0000)
committerPatrick McHardy <kaber@trash.net>
Tue, 20 Jun 2006 13:45:38 +0000 (13:45 +0000)
As pointed out by Nicolas Mailhot in bugzilla #483, REDIRECT
does not accept an IP address and when supplied with one,
provides unexpected results.  Patch below fixes this.

extensions/libipt_REDIRECT.c

index e29bf2ff7b6fc205252410b78e50852d3c7113c5..13195b0c000d60c45f0f14dccfc93d86b82e573c 100644 (file)
@@ -44,6 +44,9 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
 
        mr->range[0].flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
 
+       if (strchr(arg, '.'))
+               exit_error(PARAMETER_PROBLEM, "IP address not permitted\n");
+
        port = atoi(arg);
        if (port == 0 || port > 65535)
                exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg);