[netfilter-cvslog] r7425 - trunk/iptables/extensions

kaber at trash.net kaber at trash.net
Wed Apr 2 12:25:34 CEST 2008


Author: kaber at trash.net
Date: 2008-04-02 12:25:33 +0200 (Wed, 02 Apr 2008)
New Revision: 7425

Modified:
   trunk/iptables/extensions/libxt_iprange.c
Log:
[IPTABLES]: libxt_iprange: Fix IP validation logic

IP address validation logic was inverted, causing valid addresses to
be rejected.

Signed-off-by: James King <t.james.king at gmail.com> 


Modified: trunk/iptables/extensions/libxt_iprange.c
===================================================================
--- trunk/iptables/extensions/libxt_iprange.c	2008-03-26 15:58:42 UTC (rev 7424)
+++ trunk/iptables/extensions/libxt_iprange.c	2008-04-02 10:25:33 UTC (rev 7425)
@@ -41,14 +41,14 @@
 		*dash = '\0';
 
 	ip = numeric_to_ipaddr(arg);
-	if (ip != NULL)
+	if (!ip)
 		exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n",
 			   arg);
 	range->min_ip = ip->s_addr;
 
 	if (dash != NULL) {
 		ip = numeric_to_ipaddr(dash+1);
-		if (ip != NULL)
+		if (!ip)
 			exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n",
 				   dash+1);
 		range->max_ip = ip->s_addr;




More information about the netfilter-cvslog mailing list