From: Marcus Sundberg <marcus@ingate.com>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] ip_ct_refresh_optimization.patch
Date: 12 Sep 2002 10:41:14 +0200 [thread overview]
Message-ID: <vebs73bnx1.fsf@inigo.ingate.se> (raw)
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/
next reply other threads:[~2002-09-12 8:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-12 8:41 Marcus Sundberg [this message]
2002-09-12 13:05 ` [PATCH] ip_ct_refresh_optimization.patch Martin Josefsson
2002-09-14 12:52 ` Marcus Sundberg
2002-09-14 13:34 ` Martin Josefsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vebs73bnx1.fsf@inigo.ingate.se \
--to=marcus@ingate.com \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.