* [PATCH] DNAT/SNAT port range must use dash
@ 2005-01-17 0:33 Phil Oester
2005-02-01 12:53 ` Harald Welte
0 siblings, 1 reply; 2+ messages in thread
From: Phil Oester @ 2005-01-17 0:33 UTC (permalink / raw)
To: netfilter-devel
[-- Attachment #1: Type: text/plain, Size: 316 bytes --]
John McCann points out via bugzilla that iptables happily accepts this
syntax on DNAT/SNAT:
--to x.x.x.x:y:z
but doesn't actually make use of the second port. Clear up the confusion
by only accepting a dash between the ports.
This closes bugzilla #265.
Phil
Signed-off-by: Phil Oester <kernel@linuxace.com>
[-- Attachment #2: patch-colons --]
[-- Type: text/plain, Size: 1528 bytes --]
diff -ru iptables-orig/extensions/libipt_DNAT.c iptables-new/extensions/libipt_DNAT.c
--- iptables-orig/extensions/libipt_DNAT.c 2004-12-28 08:11:59.000000000 -0500
+++ iptables-new/extensions/libipt_DNAT.c 2005-01-16 19:26:29.059808992 -0500
@@ -65,7 +65,7 @@
parse_to(char *arg, int portok, struct ipt_natinfo *info)
{
struct ip_nat_range range;
- char *colon, *dash;
+ char *colon, *dash, *error;
struct in_addr *ip;
memset(&range, 0, sizeof(range));
@@ -85,6 +85,11 @@
exit_error(PARAMETER_PROBLEM,
"Port `%s' not valid\n", colon+1);
+ error = strchr(colon+1, ':');
+ if (error)
+ exit_error(PARAMETER_PROBLEM,
+ "Invalid port:port syntax - use dash\n");
+
dash = strchr(colon, '-');
if (!dash) {
range.min.tcp.port
diff -ru iptables-orig/extensions/libipt_SNAT.c iptables-new/extensions/libipt_SNAT.c
--- iptables-orig/extensions/libipt_SNAT.c 2004-12-28 08:11:59.000000000 -0500
+++ iptables-new/extensions/libipt_SNAT.c 2005-01-16 19:13:42.446351952 -0500
@@ -65,7 +65,7 @@
parse_to(char *arg, int portok, struct ipt_natinfo *info)
{
struct ip_nat_range range;
- char *colon, *dash;
+ char *colon, *dash, *error;
struct in_addr *ip;
memset(&range, 0, sizeof(range));
@@ -85,6 +85,11 @@
exit_error(PARAMETER_PROBLEM,
"Port `%s' not valid\n", colon+1);
+ error = strchr(colon+1, ':');
+ if (error)
+ exit_error(PARAMETER_PROBLEM,
+ "Invalid port:port syntax - use dash\n");
+
dash = strchr(colon, '-');
if (!dash) {
range.min.tcp.port
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] DNAT/SNAT port range must use dash
2005-01-17 0:33 [PATCH] DNAT/SNAT port range must use dash Phil Oester
@ 2005-02-01 12:53 ` Harald Welte
0 siblings, 0 replies; 2+ messages in thread
From: Harald Welte @ 2005-02-01 12:53 UTC (permalink / raw)
To: Phil Oester; +Cc: netfilter-devel
[-- Attachment #1: Type: text/plain, Size: 493 bytes --]
On Sun, Jan 16, 2005 at 04:33:25PM -0800, Phil Oester wrote:
> This closes bugzilla #265.
thanks, applied.
> Phil
--
- Harald Welte <laforge@netfilter.org> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-02-01 12:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-17 0:33 [PATCH] DNAT/SNAT port range must use dash Phil Oester
2005-02-01 12:53 ` Harald Welte
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.