netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event
Subsystems (2)
PATCH 1/1 netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event
From: wenxu <[email protected]>
It should check the NETDEV_UNREGISTER in nft_offload_netdev_event
--- net/netfilter/nf_tables_offload.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/nf_tables_offload.c +3 -0
@@ -446,6 +446,9 @@ static int nft_offload_netdev_event(struct notifier_block *this,struct net *net =dev_net (dev);struct nft_chain *chain; +if (event !=NETDEV_UNREGISTER ) +return 0 ; +mutex_lock (&net->nft.commit_mutex); chain =__nft_offload_get_chain (dev);if (chain)
Signature · 1 line
1.8.3.1
Hi pablo,
Any comments about this patch?
BR
wenxu
Quoted 24 lines · On 11/13/2019 12:21 PM, [email protected] wrote:
From: wenxu <[email protected]>
It should check the
NETDEV_UNREGISTERinnft_offload_netdev_eventFixes 06d392cbe3db ("netfilter: nf_tables_offload: remove rules when the device unregisters")Signed-off-by wenxu <[email protected]>--- net/netfilter/nf_tables_offload.c | 3 +++ 1 file changed, 3 insertions(+)net/netfilter/nf_tables_offload.c +3
-0@@ -446,6 +446,9 @@ static int nft_offload_netdev_event(struct notifier_block *this,struct net *net =dev_net (dev);struct nft_chain *chain; +if (event !=NETDEV_UNREGISTER ) +return 0 ; +mutex_lock (&net->nft.commit_mutex); chain =__nft_offload_get_chain (dev);if (chain)
Quoted 3 lines · On Wed, Nov 13, 2019 at 12:21:07PM +0800, [email protected] wrote:
From: wenxu <[email protected]>
It should check the
NETDEV_UNREGISTERinnft_offload_netdev_event
Applied, thanks.
Pablo Neira Ayuso
maintainerQuoted 15 lines · On Wed, Nov 13, 2019 at 12:21:07PM +0800, [email protected] wrote:
From: wenxu <[email protected]>
It should check the
NETDEV_UNREGISTERinnft_offload_netdev_eventFixes 06d392cbe3db ("netfilter: nf_tables_offload: remove rules when the device unregisters")Signed-off-by wenxu <[email protected]>--- net/netfilter/nf_tables_offload.c | 3 +++ 1 file changed, 3 insertions(+)net/netfilter/nf_tables_offload.c +0
-0
net/netfilter/nf_tables_offload.c static int nft_offload_netdev_event(struct notifier_block *this, · line 450
Quoted 5 lines
net/netfilter/nf_tables_offload.c +2
-0@@ -446,6 +446,9 @@ static int nft_offload_netdev_event(struct notifier_block *this,struct net *net =dev_net (dev);struct nft_chain *chain; +if (event !=NETDEV_UNREGISTER ) +return 0 ;
Actually I cannot apply this.
if (event != NETDEV_UNREGISTER &&
event != NETDEV_CHANGENAME)
return NOTIFY_DONE;You also have to check for change name and use NOTIFY_DONE as return value instead. Sorry.
Pablo Neira Ayuso
maintainerQuoted 24 lines · Pablo Neira Ayuso
Quoted 15 lines · On Wed, Nov 13, 2019 at 12:21:07PM +0800, [email protected] wrote:
From: wenxu <[email protected]>
It should check the
NETDEV_UNREGISTERinnft_offload_netdev_eventFixes 06d392cbe3db ("netfilter: nf_tables_offload: remove rules when the device unregisters")Signed-off-by wenxu <[email protected]>--- net/netfilter/nf_tables_offload.c | 3 +++ 1 file changed, 3 insertions(+)net/netfilter/nf_tables_offload.c +0
-0net/netfilter/nf_tables_offload.c static int nft_offload_netdev_event(struct notifier_block *this, · line 450
Quoted 5 lines
net/netfilter/nf_tables_offload.c +2
-0@@ -446,6 +446,9 @@ static int nft_offload_netdev_event(struct notifier_block *this,struct net *net =dev_net (dev);struct nft_chain *chain; +if (event !=NETDEV_UNREGISTER ) +return 0 ;Actually I cannot apply this.
Quoted 6 lines
if (event != NETDEV_UNREGISTER && event != NETDEV_CHANGENAME) return NOTIFY_DONE;You also have to check for change name and use
NOTIFY_DONEas return value instead. Sorry.
It's only NOTIFY_DONE that is missing.
I'll mangle this patch and apply, no need to send a new version.