netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xt_recent: Fix false hit_count match
@ 2010-02-19 17:49 Tim Gardner
  2010-02-23 13:59 ` Patrick McHardy
  0 siblings, 1 reply; 10+ messages in thread
From: Tim Gardner @ 2010-02-19 17:49 UTC (permalink / raw)
  To: kaber; +Cc: coreteam, netfilter-devel, netfilter

>From 146111514a8c126268e848e45b7dd967329b072f Mon Sep 17 00:00:00 2001
From: Tim Gardner <tim.gardner@canonical.com>
Date: Thu, 18 Feb 2010 20:33:00 -0700
Subject: [PATCH] xt_recent: Fix false match.

A rule with a zero hit_count will always match.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Cc: stable@kernel.org
---
 net/netfilter/xt_recent.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 1bb0d6c..43e83a4 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -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 (++hits >= info->hit_count) {
+			if (info->hit_count && ++hits >= info->hit_count) {
 				ret = !ret;
 				break;
 			}
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-03-22 19:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-19 17:49 [PATCH] xt_recent: Fix false hit_count match Tim Gardner
2010-02-23 13:59 ` Patrick McHardy
2010-03-19 15:04   ` Thomas Jarosch
2010-03-19 15:41     ` Patrick McHardy
2010-03-19 16:14       ` Tim Gardner
2010-03-19 16:19       ` Thomas Jarosch
2010-03-19 16:32         ` Patrick McHardy
2010-03-19 16:38           ` Tim Gardner
2010-03-22 17:31         ` Patrick McHardy
2010-03-22 19:14           ` Thomas Jarosch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).