Skip to content

Commit

Permalink
xt_quota: report initial quota value instead of current value to user…
Browse files Browse the repository at this point in the history
…space

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>
  • Loading branch information
Changli Gao authored and Patrick McHardy committed Jul 23, 2010
1 parent b0c81aa commit 49daf6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion include/linux/netfilter/xt_quota.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ struct xt_quota_priv;
struct xt_quota_info {
u_int32_t flags;
u_int32_t pad;
aligned_u64 quota;

/* Used internally by the kernel */
aligned_u64 quota;
struct xt_quota_priv *master;
};

Expand Down
2 changes: 0 additions & 2 deletions net/netfilter/xt_quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ quota_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* we do not allow even small packets from now on */
priv->quota = 0;
}
/* Copy quota back to matchinfo so that iptables can display it */
q->quota = priv->quota;
spin_unlock_bh(&priv->lock);

return ret;
Expand Down

0 comments on commit 49daf6a

Please sign in to comment.