netfilter 06/29: netns ebtables: more cleanup during ebt_unregister_table()

Submitted by Patrick McHardy on Nov. 27, 2008, 4:15 p.m.


Message ID 20081127161511.13891.54960.sendpatchset@x2.localnet
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Patrick McHardy Nov. 27, 2008, 4:15 p.m.
commit dbcdf85a2e3d2aa584dafd10b5a1f42764e673e7
Author: Alexey Dobriyan <>
Date:   Tue Nov 4 14:28:04 2008 +0100

    netfilter: 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.
    Signed-off-by: Alexey Dobriyan <>
    Signed-off-by: Patrick McHardy <>

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Patch hide | download patch | download mbox

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 82e1752..fa108c4 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1209,6 +1209,10 @@  void ebt_unregister_table(struct ebt_table *table)
+	EBT_ENTRY_ITERATE(table->private->entries, table->private->entries_size,
+			  ebt_cleanup_entry, NULL);
+	if (table->private->nentries)
+		module_put(table->me);
 	if (table->private->chainstack) {