summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChenbo Feng <fengc@google.com>2018-10-01 18:23:07 -0700
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-09 01:14:30 +0200
commit0a8f2bcadff157489a737f8cc8846adcb750b91f (patch)
treeca58c1dca192c6ce765130cd707314ac77d26672 /include
parentb373a91b24c4bb1074f304bc74ce2f361c818a5a (diff)
extensions: libxt_quota: Allow setting the remaining quota
The current xt_quota module cannot track the current remaining quota of a specific rule. Everytime an unrelated rule is updated in the same iptables table, the quota will be reset. This is not a very useful function for iptables that get changed at run time. This patch fixes the above problem by adding a new field in the struct that records the current remaining quota. Fixed a print out bug in verbose print out wrt. inversion. Signed-off-by: Chenbo Feng <fengc@google.com> Suggested-by: Maciej Żenczykowski <maze@google.com> Reviewed-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter/xt_quota.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h
index 9314723f..d817aab2 100644
--- a/include/linux/netfilter/xt_quota.h
+++ b/include/linux/netfilter/xt_quota.h
@@ -14,9 +14,11 @@ struct xt_quota_info {
__u32 flags;
__u32 pad;
__aligned_u64 quota;
-
- /* Used internally by the kernel */
- struct xt_quota_priv *master;
+#ifdef __KERNEL__
+ atomic64_t counter;
+#else
+ __aligned_u64 remain;
+#endif
};
#endif /* _XT_QUOTA_H */