]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
xt_quota: report initial quota value instead of current value to userspace
authorChangli Gao <xiaosuo@gmail.com>
Fri, 23 Jul 2010 12:07:47 +0000 (14:07 +0200)
committerPatrick McHardy <kaber@trash.net>
Fri, 23 Jul 2010 12:07:47 +0000 (14:07 +0200)
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>
include/linux/netfilter/xt_quota.h
net/netfilter/xt_quota.c

index 8dc89dfc1361761578ef2c73fd6dcdce74327f0f..b0d28c659ab75c7a87aa9e4cb956c516bf5aeaf1 100644 (file)
@@ -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;
 };
 
index 304b1fda1a0d31abd3b3352fb866fa6f5b3b7c60..70eb2b4984ddb277e052458f325599910e57d875 100644 (file)
@@ -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;