diff options
author | Phil Oester <kernel@linuxace.com> | 2006-08-08 09:59:59 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2006-08-08 09:59:59 +0000 |
commit | ae35309923339354b48adac4fa703bd3f5e6dd2b (patch) | |
tree | 73bd5b1e90bce35f7de8ac3d4acb85d1576e5078 | |
parent | c1eae41e1957db56aaf7afcafa2f097042fa4217 (diff) |
update quota match for xtables + fix -D bug (Phil Oester <kernel@linuxace.com>)
-rwxr-xr-x | extensions/.quota-test | 2 | ||||
-rw-r--r-- | extensions/libipt_quota.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/extensions/.quota-test b/extensions/.quota-test index 761bf143..b21058c5 100755 --- a/extensions/.quota-test +++ b/extensions/.quota-test @@ -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 diff --git a/extensions/libipt_quota.c b/extensions/libipt_quota.c index a9c138c5..83807541 100644 --- a/extensions/libipt_quota.c +++ b/extensions/libipt_quota.c @@ -3,12 +3,13 @@ * * Sam Johnston <samj@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 @@ help(void) 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 @@ print(const struct ipt_ip *ip, const struct ipt_entry_match *match, int numeric) 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 @@ parse(int c, char **argv, int invert, unsigned int *flags, 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 @@ struct iptables_match quota = { .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, |