path: root/include/linux/netfilter/xt_quota.h
diff options
authorChenbo Feng <>2018-10-01 18:23:07 -0700
committerPablo Neira Ayuso <>2018-10-09 01:14:30 +0200
commit0a8f2bcadff157489a737f8cc8846adcb750b91f (patch)
treeca58c1dca192c6ce765130cd707314ac77d26672 /include/linux/netfilter/xt_quota.h
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 <> Suggested-by: Maciej ┼╗enczykowski <> Reviewed-by: Maciej ┼╗enczykowski <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include/linux/netfilter/xt_quota.h')
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;
+ __aligned_u64 remain;
#endif /* _XT_QUOTA_H */