All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] first conntrack ID must be 1 not 2
@ 2006-02-13  2:41 Pablo Neira Ayuso
  2006-02-13 11:20 ` Harald Welte
  0 siblings, 1 reply; 40+ messages in thread
From: Pablo Neira Ayuso @ 2006-02-13  2:41 UTC (permalink / raw)
  To: Netfilter Development Mailinglist
  Cc: Harald Welte, Patrick McHardy, Yasuyuki Kozakai

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

[NF_CONNTRACK] first conntrack ID must be 1 not 2

The first conntrack ID must be 1. If a new conntrack is created, the
general ID counter must be post-incremented instead pre-incremented
since [ip|nf]_conntrack_next_id is initialized to 1. Same applies for
expectations.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[-- Attachment #2: id.patch --]
[-- Type: text/plain, Size: 2225 bytes --]

[NETFILTER] first conntrack ID must be 1 not 2

The first conntrack ID must be 1. If a new conntrack is created, the
general ID counter must be post-incremented instead pre-incremented since
[ip|nf]_conntrack_next_id is initialized to 1. Same applies for expectations.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Index: net-2.6.git/net/netfilter/nf_conntrack_core.c
===================================================================
--- net-2.6.git.orig/net/netfilter/nf_conntrack_core.c	2006-02-13 01:05:04.000000000 +0100
+++ net-2.6.git/net/netfilter/nf_conntrack_core.c	2006-02-13 01:47:04.000000000 +0100
@@ -682,7 +682,7 @@ static void __nf_conntrack_hash_insert(s
 				       unsigned int hash,
 				       unsigned int repl_hash) 
 {
-	ct->id = ++nf_conntrack_next_id;
+	ct->id = nf_conntrack_next_id++;
 	list_prepend(&nf_conntrack_hash[hash],
 		     &ct->tuplehash[IP_CT_DIR_ORIGINAL].list);
 	list_prepend(&nf_conntrack_hash[repl_hash],
@@ -1247,7 +1247,7 @@ static void nf_conntrack_expect_insert(s
 	exp->timeout.expires = jiffies + exp->master->helper->timeout * HZ;
 	add_timer(&exp->timeout);
 
-	exp->id = ++nf_conntrack_expect_next_id;
+	exp->id = nf_conntrack_expect_next_id++;
 	atomic_inc(&exp->use);
 	NF_CT_STAT_INC(expect_create);
 }
Index: net-2.6.git/net/ipv4/netfilter/ip_conntrack_core.c
===================================================================
--- net-2.6.git.orig/net/ipv4/netfilter/ip_conntrack_core.c	2006-02-04 14:34:40.000000000 +0100
+++ net-2.6.git/net/ipv4/netfilter/ip_conntrack_core.c	2006-02-13 01:46:42.000000000 +0100
@@ -417,7 +417,7 @@ static void __ip_conntrack_hash_insert(s
 					unsigned int hash,
 					unsigned int repl_hash) 
 {
-	ct->id = ++ip_conntrack_next_id;
+	ct->id = ip_conntrack_next_id++;
 	list_prepend(&ip_conntrack_hash[hash],
 		     &ct->tuplehash[IP_CT_DIR_ORIGINAL].list);
 	list_prepend(&ip_conntrack_hash[repl_hash],
@@ -971,7 +971,7 @@ static void ip_conntrack_expect_insert(s
 	exp->timeout.expires = jiffies + exp->master->helper->timeout * HZ;
 	add_timer(&exp->timeout);
 
-	exp->id = ++ip_conntrack_expect_next_id;
+	exp->id = ip_conntrack_expect_next_id++;
 	atomic_inc(&exp->use);
 	CONNTRACK_STAT_INC(expect_create);
 }

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

end of thread, other threads:[~2006-04-12 18:30 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-13  2:41 [PATCH 4/4] first conntrack ID must be 1 not 2 Pablo Neira Ayuso
2006-02-13 11:20 ` Harald Welte
2006-02-16  8:33   ` Patrick McHardy
2006-02-16  8:47     ` Jozsef Kadlecsik
2006-02-16  9:02       ` Patrick McHardy
2006-02-16  9:11         ` Jozsef Kadlecsik
2006-02-16  9:14           ` Patrick McHardy
2006-02-16  9:36             ` Jozsef Kadlecsik
2006-02-16 20:09               ` Patrick McHardy
2006-02-17  8:18                 ` Jozsef Kadlecsik
2006-02-17  8:45                   ` Martin Josefsson
2006-02-17  9:30                     ` Jozsef Kadlecsik
2006-02-17 18:41                       ` Jozsef Kadlecsik
2006-03-04 16:23                         ` Hashtrie testing (was: Re: [PATCH 4/4] first conntrack ID must be 1 not 2) Martin Josefsson
2006-03-05  9:49                           ` Jozsef Kadlecsik
2006-03-05 13:24                             ` Martin Josefsson
2006-03-04 20:11                       ` Hashtrie testing2 " Martin Josefsson
2006-03-05 11:24                         ` Jozsef Kadlecsik
2006-03-05 17:48                           ` Martin Josefsson
2006-03-06 13:15                             ` Jozsef Kadlecsik
2006-03-07 18:33                               ` Martin Josefsson
2006-03-08  6:34                                 ` Patrick Schaaf
2006-03-12 18:49                                 ` Martin Josefsson
2006-03-14 11:35                                   ` Jozsef Kadlecsik
2006-03-23 11:27                                   ` Jozsef Kadlecsik
2006-03-23 21:07                                     ` Martin Josefsson
2006-03-25  8:39                                       ` Jozsef Kadlecsik
2006-03-28 12:26                                         ` Jozsef Kadlecsik
2006-03-30  8:28                                 ` Hashtrie testing2, dancing trees Amin Azez
2006-03-31 18:43                                   ` Jozsef Kadlecsik
2006-02-17  8:50                   ` [PATCH 4/4] first conntrack ID must be 1 not 2 Patrick McHardy
2006-03-30  8:31                 ` Amin Azez
2006-03-31  1:11                   ` Patrick McHardy
2006-03-31 18:35                     ` Jozsef Kadlecsik
2006-03-31 18:44                       ` Patrick McHardy
2006-04-01 19:31                         ` Harald Welte
2006-04-06 11:02                           ` Patrick McHardy
2006-04-11 16:09                             ` Amin Azez
2006-04-11 16:17                               ` Patrick McHardy
     [not found]                                 ` <443CA579.3030908@ufomechanic.net>
2006-04-12 18:30                                   ` Patrick McHardy

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.