From ae35309923339354b48adac4fa703bd3f5e6dd2b Mon Sep 17 00:00:00 2001 From: Phil Oester Date: Tue, 8 Aug 2006 09:59:59 +0000 Subject: update quota match for xtables + fix -D bug (Phil Oester ) --- extensions/libipt_quota.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'extensions/libipt_quota.c') 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 */ +#include #include #include #include #include -#include +#include #include 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, -- cgit v1.2.3