summaryrefslogtreecommitdiff
path: root/net/netfilter/nft_chain_filter.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-10-22 11:41:16 +0100
committerDavid S. Miller <davem@davemloft.net>2021-10-22 11:41:16 +0100
commitbdfa75ad70e93633e18b1ed2b3866c01aa9bf9d2 (patch)
tree45115e9c988cbaa49f3766cbe6e6775757cb8c20 /net/netfilter/nft_chain_filter.c
parentab98bbee072c7c30c391ae742b209efebb468273 (diff)
parent64222515138e43da1fcf288f0289ef1020427b87 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Lots of simnple overlapping additions. With a build fix from Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nft_chain_filter.c')
-rw-r--r--net/netfilter/nft_chain_filter.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/netfilter/nft_chain_filter.c b/net/netfilter/nft_chain_filter.c
index 680fe557686e..c3563f0be269 100644
--- a/net/netfilter/nft_chain_filter.c
+++ b/net/netfilter/nft_chain_filter.c
@@ -344,12 +344,6 @@ static void nft_netdev_event(unsigned long event, struct net_device *dev,
return;
}
- /* UNREGISTER events are also happening on netns exit.
- *
- * Although nf_tables core releases all tables/chains, only this event
- * handler provides guarantee that hook->ops.dev is still accessible,
- * so we cannot skip exiting net namespaces.
- */
__nft_release_basechain(ctx);
}
@@ -368,6 +362,9 @@ static int nf_tables_netdev_event(struct notifier_block *this,
event != NETDEV_CHANGENAME)
return NOTIFY_DONE;
+ if (!check_net(ctx.net))
+ return NOTIFY_DONE;
+
nft_net = nft_pernet(ctx.net);
mutex_lock(&nft_net->commit_mutex);
list_for_each_entry(table, &nft_net->tables, list) {