Skip to content

Commit 392b408

Browse files
committed
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 <[email protected]>
2 parents 5e19997 + 82e6bfe commit 392b408

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/netfilter/xt_limit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ static int limit_mt_check(const struct xt_mtchk_param *par)
117117

118118
/* For SMP, we only want to use one set of state. */
119119
r->master = priv;
120+
/* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies *
121+
128. */
122+
priv->prev = jiffies;
123+
priv->credit = user2credits(r->avg * r->burst); /* Credits full. */
120124
if (r->cost == 0) {
121-
/* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies *
122-
128. */
123-
priv->prev = jiffies;
124-
priv->credit = user2credits(r->avg * r->burst); /* Credits full. */
125125
r->credit_cap = priv->credit; /* Credits full. */
126126
r->cost = user2credits(r->avg);
127127
}

0 commit comments

Comments
 (0)