netfilter 03/08: xt_recent: fix false match

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Patrick McHardy
Date: Wednesday, February 24, 2010 - 10:49 am

commit 8ccb92ad41cb311e52ad1b1fe77992c7f47a3b63
Author: Tim Gardner <tim.gardner@canonical.com>
Date:   Tue Feb 23 14:59:12 2010 +0100

    netfilter: 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
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 1278f0a..7073dbb 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -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;
 			}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
netfilter 00/08: netfilter update, Patrick McHardy, (Wed Feb 24, 10:49 am)
netfilter 02/08: xt_recent: fix buffer overflow, Patrick McHardy, (Wed Feb 24, 10:49 am)
netfilter 03/08: xt_recent: fix false match, Patrick McHardy, (Wed Feb 24, 10:49 am)
netfilter 04/08: xtables: replace XT_ENTRY_ITERATE macro, Patrick McHardy, (Wed Feb 24, 10:49 am)
netfilter 06/08: xtables: replace XT_MATCH_ITERATE macro, Patrick McHardy, (Wed Feb 24, 10:49 am)
netfilter 08/08: xtables: reduce arguments to translate_table, Patrick McHardy, (Wed Feb 24, 10:49 am)
Re: netfilter 00/08: netfilter update, Shan Wei, (Wed Feb 24, 6:36 pm)
Re: netfilter 00/08: netfilter update, Patrick McHardy, (Thu Feb 25, 10:35 am)