Skip to contentSkip to conversation

: invalid port number in libipt_MASQUERADE.c

PATCH Applied Yasuyuki Kozakai 2 participants 2 messages Oct 30, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : invalid port number in libipt_MASQUERADE.c

Hi,

This small patch fixes the bug that allows

	iptables -t nat -I POSTROUTING -p tcp -j MASQUERADE --to-port -1
	                                                             ^^^^

----------------------------------------
Yasuyuki KOZAKAI

Communication Platform Laboratory,
Corporate Research & Development Center,
Toshiba Corporation

[email protected]
----------------------------------------

extensions/libipt_MASQUERADE.c +1 -1
@@ -47,7 +47,7 @@
 	mr->range[0].flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
 
 	port = atoi(arg);
-	if (port == 0 || port > 65535)
+	if (port <= 0 || port > 65535)
 		exit_error(PARAMETER_PROBLEM, "Port `%s' not valid\n", arg);
 
 	dash = strchr(arg, '-');
#1 lore raw
Quoted 4 lines · Yasuyuki Kozakai

Hi,

This small patch fixes the bug that allows

	iptables -t nat -I POSTROUTING -p tcp -j MASQUERADE --to-port -1

Thanks, applied.

Signature · 1 line
/Martin