Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xt_quota: report initial quota value instead of current value to userspace

We should copy the initial value to userspace for iptables-save and
to allow removal of specific quota rules.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>

authored by

Changli Gao and committed by
Patrick McHardy
49daf6a2 b0c81aa5

+1 -3
+1 -1
include/linux/netfilter/xt_quota.h
··· 11 11 struct xt_quota_info { 12 12 u_int32_t flags; 13 13 u_int32_t pad; 14 + aligned_u64 quota; 14 15 15 16 /* Used internally by the kernel */ 16 - aligned_u64 quota; 17 17 struct xt_quota_priv *master; 18 18 }; 19 19
-2
net/netfilter/xt_quota.c
··· 36 36 /* we do not allow even small packets from now on */ 37 37 priv->quota = 0; 38 38 } 39 - /* Copy quota back to matchinfo so that iptables can display it */ 40 - q->quota = priv->quota; 41 39 spin_unlock_bh(&priv->lock); 42 40 43 41 return ret;