Skip to contentSkip to conversation

netns ebtables: more cleanup during ebt_unregister_table()

PATCH Applied Alexey Dobriyan 2 participants 2 messages Oct 29, 2008 – Nov 4, 2008

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

PATCH 3/7 netns ebtables: more cleanup during ebt_unregister_table()

Now that ebt_unregister_table() can be called during netns stop, and module pinning scheme can't prevent netns stop, do table cleanup by hand.

---

 net/bridge/netfilter/ebtables.c |    4 ++++
 1 file changed, 4 insertions(+)
net/bridge/netfilter/ebtables.c +4 -0
@@ -1209,6 +1209,10 @@ void ebt_unregister_table(struct ebt_table *table)
 	mutex_lock(&ebt_mutex);
 	list_del(&table->list);
 	mutex_unlock(&ebt_mutex);
+	EBT_ENTRY_ITERATE(table->private->entries, table->private->entries_size,
+			  ebt_cleanup_entry, NULL);
+	if (table->private->nentries)
+		module_put(table->me);
 	vfree(table->private->entries);
 	if (table->private->chainstack) {
 		for_each_possible_cpu(i)
#1 lore raw
Quoted 3 lines · Alexey Dobriyan

Now that ebt_unregister_table() can be called during netns stop, and module pinning scheme can't prevent netns stop, do table cleanup by hand.

Applied, thanks.