Commit 49daf6a22622d4e1619aeaad5f9f0472bf89daff

Authored by Changli Gao
Committed by Patrick McHardy
1 parent b0c81aa566

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>

Showing 2 changed files with 1 additions and 3 deletions Side-by-side Diff

include/linux/netfilter/xt_quota.h
... ... @@ -11,9 +11,9 @@
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  
net/netfilter/xt_quota.c
... ... @@ -36,8 +36,6 @@
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;