On Thu, 2002-09-12 at 10:41, Marcus Sundberg wrote: > 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); > } Yes I know it's broken, I do have a newer version but I havn't committed it to cvs. I think Patrick Shaaf's solution is a better one and we should probably go with something like that. you can find a few optimisation and other patches over at http://www.netfilter.org/~gandalf/ timer-update2-inc.diff is almost like your patch. I'm using it right now and it seems to be working fine. -- /Martin Never argue with an idiot. They drag you down to their level, then beat you with experience.