Skip to content

Commit 00dfe9b

Browse files
committed
netfilter: nftables: add helper function to release hooks of one single table
Add a function to release the hooks of one single table. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent fd02033 commit 00dfe9b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8988,15 +8988,20 @@ int __nft_release_basechain(struct nft_ctx *ctx)
89888988
}
89898989
EXPORT_SYMBOL_GPL(__nft_release_basechain);
89908990

8991+
static void __nft_release_hook(struct net *net, struct nft_table *table)
8992+
{
8993+
struct nft_chain *chain;
8994+
8995+
list_for_each_entry(chain, &table->chains, list)
8996+
nf_tables_unregister_hook(net, table, chain);
8997+
}
8998+
89918999
static void __nft_release_hooks(struct net *net)
89929000
{
89939001
struct nft_table *table;
8994-
struct nft_chain *chain;
89959002

8996-
list_for_each_entry(table, &net->nft.tables, list) {
8997-
list_for_each_entry(chain, &table->chains, list)
8998-
nf_tables_unregister_hook(net, table, chain);
8999-
}
9003+
list_for_each_entry(table, &net->nft.tables, list)
9004+
__nft_release_hook(net, table);
90009005
}
90019006

90029007
static void __nft_release_table(struct net *net, struct nft_table *table)

0 commit comments

Comments
 (0)