netfilter: netns ebtables: more cleanup during ebt_unregister_table()
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 4 Nov 2008 13:28:04 +0000 (14:28 +0100)
committerPatrick McHardy <kaber@trash.net>
Tue, 4 Nov 2008 13:28:04 +0000 (14:28 +0100)
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.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
net/bridge/netfilter/ebtables.c

index 82e17527e21ed5936d177694f7c5732d936aa6b6..fa108c46e8510d1cf447cd4501576d2fd9cf4934 100644 (file)
@@ -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)