netfilter-2.6/iptables/trunk/extensions: libipt_DNAT.c libipt_SNAT.c

pluto cvs at pld-linux.org
Wed Jun 22 14:13:41 CEST 2005


Author: pluto
Date: Wed Jun 22 14:13:39 2005
New Revision: 6162

Modified:
   netfilter-2.6/iptables/trunk/extensions/libipt_DNAT.c
   netfilter-2.6/iptables/trunk/extensions/libipt_SNAT.c
Log:
- prevent user to set negative port value of SNAT/DNAT (Yasuyuki Kozakai).


Modified: netfilter-2.6/iptables/trunk/extensions/libipt_DNAT.c
==============================================================================
--- netfilter-2.6/iptables/trunk/extensions/libipt_DNAT.c	(original)
+++ netfilter-2.6/iptables/trunk/extensions/libipt_DNAT.c	Wed Jun 22 14:13:39 2005
@@ -73,7 +73,7 @@
 		range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
 
 		port = atoi(colon+1);
-		if (port == 0 || port > 65535)
+		if (port <= 0 || port > 65535)
 			exit_error(PARAMETER_PROBLEM,
 				   "Port `%s' not valid\n", colon+1);
 
@@ -91,7 +91,7 @@
 			int maxport;
 
 			maxport = atoi(dash + 1);
-			if (maxport == 0 || maxport > 65535)
+			if (maxport <= 0 || maxport > 65535)
 				exit_error(PARAMETER_PROBLEM,
 					   "Port `%s' not valid\n", dash+1);
 			if (maxport < port)

Modified: netfilter-2.6/iptables/trunk/extensions/libipt_SNAT.c
==============================================================================
--- netfilter-2.6/iptables/trunk/extensions/libipt_SNAT.c	(original)
+++ netfilter-2.6/iptables/trunk/extensions/libipt_SNAT.c	Wed Jun 22 14:13:39 2005
@@ -73,7 +73,7 @@
 		range.flags |= IP_NAT_RANGE_PROTO_SPECIFIED;
 
 		port = atoi(colon+1);
-		if (port == 0 || port > 65535)
+		if (port <= 0 || port > 65535)
 			exit_error(PARAMETER_PROBLEM,
 				   "Port `%s' not valid\n", colon+1);
 
@@ -91,7 +91,7 @@
 			int maxport;
 
 			maxport = atoi(dash + 1);
-			if (maxport == 0 || maxport > 65535)
+			if (maxport <= 0 || maxport > 65535)
 				exit_error(PARAMETER_PROBLEM,
 					   "Port `%s' not valid\n", dash+1);
 			if (maxport < port)



More information about the pld-cvs-commit mailing list