]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
REDIRECT: Allow symbolic port in REDIRECT --to-port
authorKristof Provost <kristof@sigsegv.be>
Sun, 25 May 2008 22:55:34 +0000 (00:55 +0200)
committerPatrick McHardy <kaber@trash.net>
Sun, 25 May 2008 22:55:34 +0000 (00:55 +0200)
Fixes Bugzilla 482.

Signed-off-by: Kristof Provost <kristof@sigsegv.be>
extensions/libipt_REDIRECT.c

index b4c73bbeeefd98e31e7cdc31b7046967e1feacdf..c03562b1beb21e26e977afe035d91a657ce162c2 100644 (file)
@@ -49,6 +49,9 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
                exit_error(PARAMETER_PROBLEM, "IP address not permitted\n");
 
        port = atoi(arg);
+       if (port == 0)
+               port = service_to_port(arg, NULL);
+
        if (port == 0 || port > 65535)
                exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg);