Skip to contentSkip to conversation

: Wait until all references to ip_conntrack_untracked are dropped on unload

PATCH Applied Patrick McHardy 2 participants 2 messages Jul 22, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/5 : Wait until all references to ip_conntrack_untracked are dropped on unload

[NETFILTER]: Wait until all references to ip_conntrack_untracked are dropped on unload

Fixes a crash when unloading ip_conntrack.

---
commit dd51c6e4ab8df9819d686b0a88a6d7ec8b3d2b28
tree 1b8d3369a5ffff34a263c2c4fbb206d948178a30
parent ca30527af14847bab487c91df56f99df3c7ad1b2
author Patrick McHardy <[email protected]> Fri, 22 Jul 2005 09:23:28 +0200 committer Patrick McHardy <[email protected]> Fri, 22 Jul 2005 09:23:28 +0200

 net/ipv4/netfilter/ip_conntrack_core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
net/ipv4/netfilter/ip_conntrack_core.c +3 -0
@@ -1111,6 +1111,9 @@ void ip_conntrack_cleanup(void)
 		schedule();
 		goto i_see_dead_people;
 	}
+	/* wait until all references to ip_conntrack_untracked are dropped */
+	while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1)
+		schedule();
 
 	kmem_cache_destroy(ip_conntrack_cachep);
 	kmem_cache_destroy(ip_conntrack_expect_cachep);