Skip to content

Commit

Permalink
Merge branch 'master' of git://1984.lsi.us.es/nf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Sep 27, 2012
2 parents 5e19997 + 82e6bfe commit 392b408
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/netfilter/xt_limit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 392b408

Please sign in to comment.