mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 07:03:37 +02:00
netfilter: xt_recent: fix regression in rules using a zero hit_count
commitef1691504cupstream. Commit8ccb92ad(netfilter: xt_recent: fix false match) fixed supposedly false matches in rules using a zero hit_count. As it turns out there is nothing false about these matches and people are actually using entries with a hit_count of zero to make rules dependant on addresses inserted manually through /proc. Since this slipped past the eyes of three reviewers, instead of reverting the commit in question, this patch explicitly checks for a hit_count of zero to make the intentions more clear. Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Tested-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
710b70e815
commit
5a32ab6f23
|
|
@ -260,7 +260,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 (info->hit_count && ++hits >= info->hit_count) {
|
||||
if (!info->hit_count || ++hits >= info->hit_count) {
|
||||
ret = !ret;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user