Re: [patch net] net: forbid netdev used by mirred tc act from being moved to another netns

2017-11-14 Thread Cong Wang
On Mon, Nov 13, 2017 at 10:35 PM, Jiri Pirko wrote: > > Okay. What about my question? Should we allow adding an action mirred > pointing to a netdev in another netns? I think it would make sense in > case we consider movement of mirred device legit. I don't think it is possible

Re: [patch net] net: forbid netdev used by mirred tc act from being moved to another netns

2017-11-13 Thread Jiri Pirko
Tue, Nov 14, 2017 at 06:51:42AM CET, xiyou.wangc...@gmail.com wrote: >On Mon, Nov 13, 2017 at 9:17 PM, Jiri Pirko wrote: >> Mon, Nov 13, 2017 at 08:53:57PM CET, xiyou.wangc...@gmail.com wrote: >>>On Mon, Nov 13, 2017 at 6:05 AM, Jiri Pirko wrote: From:

Re: [patch net] net: forbid netdev used by mirred tc act from being moved to another netns

2017-11-13 Thread Cong Wang
On Mon, Nov 13, 2017 at 9:17 PM, Jiri Pirko wrote: > Mon, Nov 13, 2017 at 08:53:57PM CET, xiyou.wangc...@gmail.com wrote: >>On Mon, Nov 13, 2017 at 6:05 AM, Jiri Pirko wrote: >>> From: Jiri Pirko >>> >>> Currently, user may choose to move

Re: [patch net] net: forbid netdev used by mirred tc act from being moved to another netns

2017-11-13 Thread Jiri Pirko
Mon, Nov 13, 2017 at 08:53:57PM CET, xiyou.wangc...@gmail.com wrote: >On Mon, Nov 13, 2017 at 6:05 AM, Jiri Pirko wrote: >> From: Jiri Pirko >> >> Currently, user may choose to move device that is used by mirred action >> to another network namespace. That is

Re: [patch net] net: forbid netdev used by mirred tc act from being moved to another netns

2017-11-13 Thread Cong Wang
On Mon, Nov 13, 2017 at 6:05 AM, Jiri Pirko wrote: > From: Jiri Pirko > > Currently, user may choose to move device that is used by mirred action > to another network namespace. That is wrong as the action still remains > in the original namespace and

Re: [patch net] net: forbid netdev used by mirred tc act from being moved to another netns

2017-11-13 Thread David Ahern
On 11/13/17 7:05 AM, Jiri Pirko wrote: > diff --git a/net/core/dev.c b/net/core/dev.c > index 11596a3..877979f 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -8250,7 +8250,7 @@ int dev_change_net_namespace(struct net_device *dev, > struct net *net, const char > > /* Don't allow

[patch net] net: forbid netdev used by mirred tc act from being moved to another netns

2017-11-13 Thread Jiri Pirko
From: Jiri Pirko Currently, user may choose to move device that is used by mirred action to another network namespace. That is wrong as the action still remains in the original namespace and references non-existing ifindex. See an example to illustrate this: $ ip link add