All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ip_ct_refresh_optimization.patch
@ 2002-09-12  8:41 Marcus Sundberg
  2002-09-12 13:05 ` Martin Josefsson
  0 siblings, 1 reply; 4+ messages in thread
From: Marcus Sundberg @ 2002-09-12  8:41 UTC (permalink / raw)
  To: netfilter-devel

Hi,

The ip_ct_refresh_optimization.patch in p-o-m is completely broken,
as it doesn't handle when the timeout is decreased. This results
in TCP-connections in CLOSE and TIME_WAIT states still having the
5 day timeout they had when they were in ESTABLISHED state.

This patch always updates the timeout if the difference is >= HZ.

diff -u -r1.1 ip_ct_refresh_optimization.patch
--- patch-o-matic/optimizations/ip_ct_refresh_optimization.patch	11 Jun 2002 08:02:57 -0000	1.1
+++ patch-o-matic/optimizations/ip_ct_refresh_optimization.patch	12 Sep 2002 08:11:52 -0000
@@ -69,7 +69,7 @@
 +		/* Don't update timer for each packet, only if it's been >HZ
 +		 * ticks since last update.
 +		 * Need del_timer for race avoidance (may already be dying). */
-+		if (time_after(jiffies, ct->timeout.expires - extra_jiffies + HZ) && del_timer(&ct->timeout)) {
++		if (abs(jiffies + extra_jiffies - ct->timeout.expires) >= HZ && del_timer(&ct->timeout)) {
  			ct->timeout.expires = jiffies + extra_jiffies;
  			add_timer(&ct->timeout);
  		}

//Marcus
-- 
---------------------------------------+--------------------------
  Marcus Sundberg <marcus@ingate.com>  | Firewalls with SIP & NAT
 Firewall Developer, Ingate Systems AB |  http://www.ingate.com/

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

end of thread, other threads:[~2002-09-14 13:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-12  8:41 [PATCH] ip_ct_refresh_optimization.patch Marcus Sundberg
2002-09-12 13:05 ` Martin Josefsson
2002-09-14 12:52   ` Marcus Sundberg
2002-09-14 13:34     ` Martin Josefsson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.