Re: [patch net] net: forbid netdev used by mirred tc act from being moved to another netns
From: Jiri Pirko <jiri@resnulli.us>
Date: 2017-11-14 06:35:54
Tue, Nov 14, 2017 at 06:51:42AM CET, xiyou.wangcong@gmail.com wrote:
On Mon, Nov 13, 2017 at 9:17 PM, Jiri Pirko [off-list ref] wrote:quoted
Mon, Nov 13, 2017 at 08:53:57PM CET, xiyou.wangcong@gmail.com wrote:quoted
On Mon, Nov 13, 2017 at 6:05 AM, Jiri Pirko [off-list ref] wrote:quoted
From: Jiri Pirko <redacted> 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.It is a pure display issue, the action itself should function well because we only use ifindex to lookup netdevice once and we save the netdevice pointer in action. If you really want to fix it, just tell iprout2 to display netnsid together with ifindex.It is not only display issue. I think it is wrong to let a netdeviceWhat's wrong with it? Is it mis-functioning?
Nope.
quoted
dissapear from underneath the mirred action. You certainly cannot add anIt disappears only because we don't display it properly, nothing else.
Okay.
quoted
action mirred with device from another net namespace. So should we allow that?On the other hand why linking a device to mirred action prevents it from moving to another netns? Also, device can be moved back too. I don't see anything wrong with it except displaying it.
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.