summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-09-27 19:16:14 +0200
committerDavid S. Miller <davem@davemloft.net>2012-09-27 19:16:14 +0200
commit392b408782324e62709f080a84de2866f7b125d4 (patch)
treed6456eb38979a4fa3b5341cb9408ccb8e166da1d /net
parentMerge tag 'for-linus' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming (diff)
parentnetfilter: xt_limit: have r->cost != 0 case work (diff)
downloadlinux-392b408782324e62709f080a84de2866f7b125d4.tar.xz
linux-392b408782324e62709f080a84de2866f7b125d4.zip
Merge branch 'master' of git://1984.lsi.us.es/nf
Pablo Neira Ayuso says: ==================== If time allows, I'd appreciate if you can take the following fix for the xt_limit match. As Jan indicates, random things may occur while using the xt_limit match due to use of uninitialized memory. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_limit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c
index 5c22ce8ab309..a4c1e4528cac 100644
--- a/net/netfilter/xt_limit.c
+++ b/net/netfilter/xt_limit.c
@@ -117,11 +117,11 @@ static int limit_mt_check(const struct xt_mtchk_param *par)
/* For SMP, we only want to use one set of state. */
r->master = priv;
+ /* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies *
+ 128. */
+ priv->prev = jiffies;
+ priv->credit = user2credits(r->avg * r->burst); /* Credits full. */
if (r->cost == 0) {
- /* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies *
- 128. */
- priv->prev = jiffies;
- priv->credit = user2credits(r->avg * r->burst); /* Credits full. */
r->credit_cap = priv->credit; /* Credits full. */
r->cost = user2credits(r->avg);
}