Skip to content

Commit

Permalink
netfilter: xt_recent: fix false match
Browse files Browse the repository at this point in the history
A rule with a zero hit_count will always match.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Tim Gardner authored and Patrick McHardy committed Feb 23, 2010
1 parent 2c08522 commit 8ccb92a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/xt_recent.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ recent_mt(const struct sk_buff *skb, const struct xt_match_param *par)
for (i = 0; i < e->nstamps; i++) {
if (info->seconds && time_after(time, e->stamps[i]))
continue;
if (++hits >= info->hit_count) {
if (info->hit_count && ++hits >= info->hit_count) {
ret = !ret;
break;
}
Expand Down

0 comments on commit 8ccb92a

Please sign in to comment.