From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: [NETFILTER 7/9]: Wait for untracked references in nf_conntrack module unload Date: Sun, 04 Dec 2005 22:01:24 +0100 Message-ID: <20051204210124.24032.98517.sendpatchset@localhost.localdomain> References: <20051204210116.24032.9802.sendpatchset@localhost.localdomain> Cc: netfilter-devel@lists.netfilter.org, Patrick McHardy Return-path: To: David S. Miller In-Reply-To: <20051204210116.24032.9802.sendpatchset@localhost.localdomain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org [NETFILTER]: Wait for untracked references in nf_conntrack module unload Noticed by Pablo Neira . Signed-off-by: Patrick McHardy --- commit 96c75906027f008ed3a4058a606938901e9c6d99 tree 87b8bb22d35f61383fbb5f4ee6164a16cc256bb3 parent aea6c7fa24378c7f38026177c0b524719789b4be author Patrick McHardy Sun, 04 Dec 2005 17:22:02 +0100 committer Patrick McHardy Sun, 04 Dec 2005 17:22:02 +0100 net/netfilter/nf_conntrack_core.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 1da6783..a99285d 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -1383,6 +1383,9 @@ void nf_conntrack_cleanup(void) schedule(); goto i_see_dead_people; } + /* wait until all references to nf_conntrack_untracked are dropped */ + while (atomic_read(&nf_conntrack_untracked.ct_general.use) > 1) + schedule(); for (i = 0; i < NF_CT_F_NUM; i++) { if (nf_ct_cache[i].use == 0)