diff options
author | Phil Sutter <phil@nwl.cc> | 2025-01-09 20:31:36 +0300 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2025-01-19 18:41:54 +0300 |
commit | fc0133428e7ad65aa6b7c8e65ccfe86e469e4512 (patch) | |
tree | ae33db1dbf7355775d5a50a2a769234a0fa27d56 /include/net | |
parent | bc87b75847d86f073a3df56e4ad44265b3d64e44 (diff) | |
download | linux-fc0133428e7ad65aa6b7c8e65ccfe86e469e4512.tar.xz |
netfilter: nf_tables: Tolerate chains with no remaining hooks
Do not drop a netdev-family chain if the last interface it is registered
for vanishes. Users dumping and storing the ruleset upon shutdown to
restore it upon next boot may otherwise lose the chain and all contained
rules. They will still lose the list of devices, a later patch will fix
that. For now, this aligns the event handler's behaviour with that for
flowtables.
The controversal situation at netns exit should be no problem here:
event handler will unregister the hooks, core nftables cleanup code will
drop the chain itself.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/netfilter/nf_tables.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index bd93d085b6fb..60d5dcdb289c 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h @@ -1238,8 +1238,6 @@ static inline bool nft_is_base_chain(const struct nft_chain *chain) return chain->flags & NFT_CHAIN_BASE; } -int __nft_release_basechain(struct nft_ctx *ctx); - unsigned int nft_do_chain(struct nft_pktinfo *pkt, void *priv); static inline bool nft_use_inc(u32 *use) |