mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									fd020332c1
								
							
						
					
					
						commit
						00dfe9bebd
					
				
					 1 changed files with 10 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -8988,15 +8988,20 @@ int __nft_release_basechain(struct nft_ctx *ctx)
 | 
			
		|||
}
 | 
			
		||||
EXPORT_SYMBOL_GPL(__nft_release_basechain);
 | 
			
		||||
 | 
			
		||||
static void __nft_release_hooks(struct net *net)
 | 
			
		||||
static void __nft_release_hook(struct net *net, struct nft_table *table)
 | 
			
		||||
{
 | 
			
		||||
	struct nft_table *table;
 | 
			
		||||
	struct nft_chain *chain;
 | 
			
		||||
 | 
			
		||||
	list_for_each_entry(table, &net->nft.tables, list) {
 | 
			
		||||
	list_for_each_entry(chain, &table->chains, list)
 | 
			
		||||
		nf_tables_unregister_hook(net, table, chain);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void __nft_release_hooks(struct net *net)
 | 
			
		||||
{
 | 
			
		||||
	struct nft_table *table;
 | 
			
		||||
 | 
			
		||||
	list_for_each_entry(table, &net->nft.tables, list)
 | 
			
		||||
		__nft_release_hook(net, table);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void __nft_release_table(struct net *net, struct nft_table *table)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue