netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter : xt_hashlimit should use time_after_eq()
@ 2007-12-12 18:39 Eric Dumazet
  2007-12-12 19:06 ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2007-12-12 18:39 UTC (permalink / raw)
  To: David S. Miller, Patrick McHardy; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

Hi David & Patrick

I believe this patch is needed for linux-2.6.24

Thank you

[PATCH] netfilter : xt_hashlimit should use time_after_eq()

In order to avoid jiffies wraparound and its effect, special care must 
be taken
when doing comparisons ...

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>



[-- Attachment #2: xt_hashlimit.patch --]
[-- Type: text/plain, Size: 511 bytes --]

diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 1910367..2ef44d8 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -240,7 +240,7 @@ static bool select_all(const struct xt_hashlimit_htable *ht,
 static bool select_gc(const struct xt_hashlimit_htable *ht,
 		      const struct dsthash_ent *he)
 {
-	return jiffies >= he->expires;
+	return time_after_eq(jiffies, he->expires);
 }
 
 static void htable_selective_cleanup(struct xt_hashlimit_htable *ht,

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

end of thread, other threads:[~2007-12-12 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12 18:39 [PATCH] netfilter : xt_hashlimit should use time_after_eq() Eric Dumazet
2007-12-12 19:06 ` Patrick McHardy
2007-12-12 19:11   ` David Miller

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).