netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event
@ 2019-11-13  4:21 wenxu
  2019-12-02  3:16 ` wenxu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: wenxu @ 2019-11-13  4:21 UTC (permalink / raw)
  To: netfilter-devel, pablo

From: wenxu <wenxu@ucloud.cn>

It should check the NETDEV_UNREGISTER in  nft_offload_netdev_event

Fixes: 06d392cbe3db ("netfilter: nf_tables_offload: remove rules when the device unregisters")
Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 net/netfilter/nf_tables_offload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
index e25dab8..b002832 100644
--- a/net/netfilter/nf_tables_offload.c
+++ b/net/netfilter/nf_tables_offload.c
@@ -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)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event
  2019-11-13  4:21 [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event wenxu
@ 2019-12-02  3:16 ` wenxu
  2019-12-02  9:21 ` Pablo Neira Ayuso
  2019-12-02  9:23 ` Pablo Neira Ayuso
  2 siblings, 0 replies; 5+ messages in thread
From: wenxu @ 2019-12-02  3:16 UTC (permalink / raw)
  To: netfilter-devel, pablo

Hi pablo,


Any comments about this patch?


BR

wenxu

On 11/13/2019 12:21 PM, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
>
> It should check the NETDEV_UNREGISTER in  nft_offload_netdev_event
>
> Fixes: 06d392cbe3db ("netfilter: nf_tables_offload: remove rules when the device unregisters")
> Signed-off-by: wenxu <wenxu@ucloud.cn>
> ---
>  net/netfilter/nf_tables_offload.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
> index e25dab8..b002832 100644
> --- a/net/netfilter/nf_tables_offload.c
> +++ b/net/netfilter/nf_tables_offload.c
> @@ -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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event
  2019-11-13  4:21 [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event wenxu
  2019-12-02  3:16 ` wenxu
@ 2019-12-02  9:21 ` Pablo Neira Ayuso
  2019-12-02  9:23 ` Pablo Neira Ayuso
  2 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2019-12-02  9:21 UTC (permalink / raw)
  To: wenxu; +Cc: netfilter-devel

On Wed, Nov 13, 2019 at 12:21:07PM +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> It should check the NETDEV_UNREGISTER in  nft_offload_netdev_event

Applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event
  2019-11-13  4:21 [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event wenxu
  2019-12-02  3:16 ` wenxu
  2019-12-02  9:21 ` Pablo Neira Ayuso
@ 2019-12-02  9:23 ` Pablo Neira Ayuso
  2019-12-02  9:25   ` Pablo Neira Ayuso
  2 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2019-12-02  9:23 UTC (permalink / raw)
  To: wenxu; +Cc: netfilter-devel

On Wed, Nov 13, 2019 at 12:21:07PM +0800, wenxu@ucloud.cn wrote:
> From: wenxu <wenxu@ucloud.cn>
> 
> It should check the NETDEV_UNREGISTER in  nft_offload_netdev_event
> 
> Fixes: 06d392cbe3db ("netfilter: nf_tables_offload: remove rules when the device unregisters")
> Signed-off-by: wenxu <wenxu@ucloud.cn>
> ---
>  net/netfilter/nf_tables_offload.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
> index e25dab8..b002832 100644
> --- a/net/netfilter/nf_tables_offload.c
> +++ b/net/netfilter/nf_tables_offload.c
> @@ -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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event
  2019-12-02  9:23 ` Pablo Neira Ayuso
@ 2019-12-02  9:25   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2019-12-02  9:25 UTC (permalink / raw)
  To: wenxu; +Cc: netfilter-devel

On Mon, Dec 02, 2019 at 10:23:10AM +0100, Pablo Neira Ayuso wrote:
> On Wed, Nov 13, 2019 at 12:21:07PM +0800, wenxu@ucloud.cn wrote:
> > From: wenxu <wenxu@ucloud.cn>
> > 
> > It should check the NETDEV_UNREGISTER in  nft_offload_netdev_event
> > 
> > Fixes: 06d392cbe3db ("netfilter: nf_tables_offload: remove rules when the device unregisters")
> > Signed-off-by: wenxu <wenxu@ucloud.cn>
> > ---
> >  net/netfilter/nf_tables_offload.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c
> > index e25dab8..b002832 100644
> > --- a/net/netfilter/nf_tables_offload.c
> > +++ b/net/netfilter/nf_tables_offload.c
> > @@ -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.

It's only NOTIFY_DONE that is missing.

I'll mangle this patch and apply, no need to send a new version.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-02  9:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-13  4:21 [PATCH nf] netfilter: nf_tables_offload: Fix check the NETDEV_UNREGISTER in netdev event wenxu
2019-12-02  3:16 ` wenxu
2019-12-02  9:21 ` Pablo Neira Ayuso
2019-12-02  9:23 ` Pablo Neira Ayuso
2019-12-02  9:25   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).