diff options
author | David S. Miller <davem@davemloft.net> | 2012-09-27 17:16:14 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-27 17:16:14 (GMT) |
commit | 392b408782324e62709f080a84de2866f7b125d4 (patch) | |
tree | d6456eb38979a4fa3b5341cb9408ccb8e166da1d | |
parent | 5e19997a742c7c8203be628a7a69babc3bcf01a4 (diff) | |
parent | 82e6bfe2fbc4d48852114c4f979137cd5bf1d1a8 (diff) | |
download | linux-392b408782324e62709f080a84de2866f7b125d4.tar.xz |
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>
-rw-r--r-- | net/netfilter/xt_limit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c index 5c22ce8..a4c1e45 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); } |