From: Eric Leblond <eric@inl.fr>
To: Patrick McHardy <kaber@trash.net>
Cc: Harald Welte <laforge@netfilter.org>,
Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
nufw-devel@nongnu.org
Subject: Re: [PATCH 1/3] [kernel patch] fixed duration connection
Date: Fri, 21 Apr 2006 22:53:14 +0200 [thread overview]
Message-ID: <1145652794.5191.3.camel@localhost.localdomain> (raw)
In-Reply-To: <444843CC.3070105@trash.net>
[-- Attachment #1.1: Type: text/plain, Size: 365 bytes --]
Le vendredi 21 avril 2006 à 04:30 +0200, Patrick McHardy a écrit :
> Eric Leblond wrote:
> Thanks. Now all I need is a Signed-off-by: line :)
> Please send one for your ctnetlink fix as well.
I attach it to the mail and I hope this is ok. I stupidly did not manage
to get an autmotic way to add the Signed-off-by ...
BR,
--
Eric Leblond <eric@inl.fr>
[-- Attachment #1.2: fixed_timeout.patch --]
[-- Type: text/x-patch, Size: 2071 bytes --]
Signed-off-by: Eric Leblond <eric@inl.fr>
---
Add fixed timeout flag in connection tracking
Add a flag in a connection status to have a non updated timeout.
This permits to have connection that automatically dye at a given
time.
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 3ff88c8..68d282d 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -69,6 +69,11 @@ enum ip_conntrack_status {
/* Connection is dying (removed from lists), can not be unset. */
IPS_DYING_BIT = 9,
IPS_DYING = (1 << IPS_DYING_BIT),
+
+ /* Connection has fixed timeout. */
+ IPS_FIXED_TIMEOUT_BIT = 10,
+ IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
+
};
/* Connection tracking event bits */
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
index ceaabc1..d34edd7 100644
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -1130,6 +1130,12 @@ void __ip_ct_refresh_acct(struct ip_conn
write_lock_bh(&ip_conntrack_lock);
+ /* Only update if this is not a fixed timeout */
+ if (test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)){
+ write_unlock_bh(&ip_conntrack_lock);
+ return;
+ }
+
/* If not in hash table, timer will not be active yet */
if (!is_confirmed(ct)) {
ct->timeout.expires = extra_jiffies;
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 56389c8..a880692 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1403,6 +1403,12 @@ void __nf_ct_refresh_acct(struct nf_conn
write_lock_bh(&nf_conntrack_lock);
+ /* Only update if this is not a fixed timeout */
+ if (test_bit(IPS_FIXED_TIMEOUT_BIT, &ct->status)) {
+ write_unlock_bh(&nf_conntrack_lock);
+ return;
+ }
+
/* If not in hash table, timer will not be active yet */
if (!nf_ct_is_confirmed(ct)) {
ct->timeout.expires = extra_jiffies;
[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
next prev parent reply other threads:[~2006-04-21 20:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-04 8:33 [PATCH 0/3] [RFC] fixed duration connection Eric Leblond
2006-04-04 8:36 ` [PATCH 1/3] " Eric Leblond
2006-04-04 8:38 ` [PATCH 2/3] " Eric Leblond
2006-04-04 8:41 ` [PATCH 3/3] [RFC] " Eric Leblond
2006-04-04 8:43 ` [PATCH 2/3] " Eric Leblond
2006-04-04 8:43 ` [PATCH 3/3] [RFC] " Eric Leblond
2006-04-05 13:57 ` [PATCH 0/3] " Patrick McHardy
2006-04-05 14:41 ` Eric Leblond
2006-04-07 21:53 ` Eric Leblond
2006-04-07 21:57 ` [PATCH 1/3] [kernel patch] " Eric Leblond
2006-04-08 19:56 ` Patrick McHardy
2006-04-08 20:55 ` Eric Leblond
2006-04-11 16:22 ` Patrick McHardy
2006-04-11 20:20 ` Eric Leblond
2006-04-12 8:38 ` Harald Welte
2006-04-12 10:48 ` Harald Welte
2006-04-12 19:06 ` Patrick McHardy
2006-04-13 16:17 ` Eric Leblond
2006-04-21 2:30 ` Patrick McHardy
2006-04-21 20:53 ` Eric Leblond [this message]
2006-04-22 0:02 ` Patrick McHardy
2006-04-07 21:59 ` [PATCH 2/3] [libnetfilter_conntrack] " Eric Leblond
2006-04-08 19:58 ` Patrick McHardy
2006-04-08 20:23 ` Eric Leblond
2006-04-07 22:01 ` [PATCH 0/3] [conntrack] " Eric Leblond
2006-04-07 22:08 ` [PATCH 3/3] " Eric Leblond
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=1145652794.5191.3.camel@localhost.localdomain \
--to=eric@inl.fr \
--cc=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
--cc=nufw-devel@nongnu.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.