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

laforge at netfilter.org laforge at netfilter.org
Tue Feb 8 16:54:18 CET 2005


Author: laforge at netfilter.org
Date: 2005-02-08 16:54:17 +0100 (Tue, 08 Feb 2005)
New Revision: 3656

Modified:
   trunk/iptables/extensions/libipt_realm.c
Log:
try to fix realm save/restore issue (Adresses: #297)


Modified: trunk/iptables/extensions/libipt_realm.c
===================================================================
--- trunk/iptables/extensions/libipt_realm.c	2005-02-08 10:28:36 UTC (rev 3655)
+++ trunk/iptables/extensions/libipt_realm.c	2005-02-08 15:54:17 UTC (rev 3656)
@@ -70,12 +70,9 @@
 }
 
 static void
-print_realm(unsigned long id, unsigned long mask, int invert, int numeric)
+print_realm(unsigned long id, unsigned long mask)
 {
-	if (invert)
-		printf("! ");
-
-	if(mask != 0xffffffff)
+	if (mask != 0xffffffff)
 		printf("0x%lx/0x%lx ", id, mask);
 	else
 		printf("0x%lx ", id);
@@ -87,10 +84,13 @@
       const struct ipt_entry_match *match,
       int numeric)
 {
+	struct ipt_realm_info *ri = (struct ipt_realm_info *) match->data;
+
+	if (ri->invert)
+		printf("! ");
+
 	printf("REALM match ");
-	print_realm(((struct ipt_realm_info *)match->data)->id,
-		   ((struct ipt_realm_info *)match->data)->mask,
-		   ((struct ipt_realm_info *)match->data)->invert, numeric);
+	print_realm(ri->id, ri->mask);
 }
 
 
@@ -98,10 +98,13 @@
 static void
 save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
 {
+	struct ipt_realm_info *ri = (struct ipt_realm_info *) match->data;
+
+	if (ri->invert)
+		printf("! ");
+
 	printf("--realm ");
-	print_realm(((struct ipt_realm_info *)match->data)->id,
-		   ((struct ipt_realm_info *)match->data)->mask,
-		   ((struct ipt_realm_info *)match->data)->invert, 0);
+	print_realm(ri->id, ri->mask);
 }
 
 /* Final check; must have specified --mark. */




More information about the netfilter-cvslog mailing list