[PATCH] REDIRECT does not accept IP
Phil Oester
kernel at linuxace.com
Tue Jun 20 03:22:08 CEST 2006
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.
Phil
-------------- next part --------------
diff -ruN ipt-orig/extensions/libipt_REDIRECT.c ipt-new/extensions/libipt_REDIRECT.c
--- ipt-orig/extensions/libipt_REDIRECT.c 2005-07-21 23:39:45.000000000 -0700
+++ ipt-new/extensions/libipt_REDIRECT.c 2006-06-19 18:14:37.000000000 -0700
@@ -44,6 +44,9 @@
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);
More information about the netfilter-devel
mailing list