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

kaber at netfilter.org kaber at netfilter.org
Tue Aug 8 11:59:59 CEST 2006


Author: kaber at netfilter.org
Date: 2006-08-08 11:59:59 +0200 (Tue, 08 Aug 2006)
New Revision: 6660

Modified:
   trunk/iptables/extensions/.quota-test
   trunk/iptables/extensions/libipt_quota.c
Log:
[PATCH] update quota match for xtables + fix -D bug (Phil Oester <kernel at linuxace.com>)


Modified: trunk/iptables/extensions/.quota-test
===================================================================
--- trunk/iptables/extensions/.quota-test	2006-08-08 09:58:29 UTC (rev 6659)
+++ trunk/iptables/extensions/.quota-test	2006-08-08 09:59:59 UTC (rev 6660)
@@ -1,3 +1,3 @@
 #!/bin/sh
-[ -f $KERNEL_DIR/include/linux/netfilter_ipv4/ipt_quota.h ] && echo quota
+[ -f $KERNEL_DIR/include/linux/netfilter/xt_quota.h ] && echo quota
 

Modified: trunk/iptables/extensions/libipt_quota.c
===================================================================
--- trunk/iptables/extensions/libipt_quota.c	2006-08-08 09:58:29 UTC (rev 6659)
+++ trunk/iptables/extensions/libipt_quota.c	2006-08-08 09:59:59 UTC (rev 6660)
@@ -3,12 +3,13 @@
  *
  * Sam Johnston <samj at samj.net>
  */
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
 #include <iptables.h>
 
-#include <linux/netfilter_ipv4/ipt_quota.h>
+#include <linux/netfilter/xt_quota.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 
 static struct option opts[] = {
@@ -28,7 +29,7 @@
 static void
 print(const struct ipt_ip *ip, const struct ipt_entry_match *match, int numeric)
 {
-        struct ipt_quota_info *q = (struct ipt_quota_info *) match->data;
+        struct xt_quota_info *q = (struct xt_quota_info *) match->data;
         printf("quota: %llu bytes", (unsigned long long) q->quota);
 }
 
@@ -36,7 +37,7 @@
 static void
 save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
 {
-        struct ipt_quota_info *q = (struct ipt_quota_info *) match->data;
+        struct xt_quota_info *q = (struct xt_quota_info *) match->data;
         printf("--quota %llu ", (unsigned long long) q->quota);
 }
 
@@ -62,7 +63,7 @@
       const struct ipt_entry *entry,
       unsigned int *nfcache, struct ipt_entry_match **match)
 {
-        struct ipt_quota_info *info = (struct ipt_quota_info *) (*match)->data;
+        struct xt_quota_info *info = (struct xt_quota_info *) (*match)->data;
 
         switch (c) {
         case '1':
@@ -89,8 +90,8 @@
 	.next		= NULL,
 	.name		= "quota",
 	.version	= IPTABLES_VERSION,
-	.size		= IPT_ALIGN(sizeof (struct ipt_quota_info)),
-	.userspacesize	= IPT_ALIGN(sizeof (struct ipt_quota_info)),
+	.size		= IPT_ALIGN(sizeof (struct xt_quota_info)),
+	.userspacesize	= offsetof(struct xt_quota_info, quota),
 	.help		= &help,
 	.parse		= &parse,
 	.final_check	= &final_check,




More information about the netfilter-cvslog mailing list