Skip to contentSkip to conversation

netfilter : xt_hashlimit should use time_after_eq()

PATCH Applied Eric Dumazet 3 participants 3 messages Dec 12, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter : xt_hashlimit should use time_after_eq()

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

net/netfilter/xt_hashlimit.c +1 -1
index 1910367..2ef44d8 100644
@@ -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,
#1 lore raw
Quoted 10 lines · Eric Dumazet

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

Looks good, thanks Eric. Dave, please apply.

maintainer Applied
#2 lore raw

From: Patrick McHardy <[email protected]>
Date: Wed, 12 Dec 2007 20:06:47 +0100

Quoted 7 lines
Quoted 6 lines · Eric Dumazet

Hi David & Patrick

I believe this patch is needed for linux-2.6.24

Thank you

Quoted 8 lines
Quoted 5 lines

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

Looks good, thanks Eric. Dave, please apply.

Applied, thanks.