[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e437f0bf-5f60-8fad-d6c5-ae84f035ac8c@gmail.com>
Date: Mon, 13 Nov 2017 10:37:10 -0700
From: David Ahern <dsahern@...il.com>
To: Jiri Pirko <jiri@...nulli.us>, netdev@...r.kernel.org
Cc: davem@...emloft.net, jhs@...atatu.com, xiyou.wangcong@...il.com,
mlxsw@...lanox.com, idosch@...lanox.com, edumazet@...gle.com,
willemb@...gle.com, me@...in.cc, john.fastabend@...il.com,
jakub.kicinski@...ronome.com, daniel@...earbox.net
Subject: Re: [patch net] net: forbid netdev used by mirred tc act from being
moved to another netns
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 namespace local devices to be moved. */
> err = -EINVAL;
> - if (dev->features & NETIF_F_NETNS_LOCAL)
> + if (dev->features & NETIF_F_NETNS_LOCAL || dev_netns_blocked(dev))
> goto out;
>
> /* Ensure the device has been registrered */
Add the extack arg to dev_change_net_namespace and tell user why the
namespace change is not allowed. And for the netns_blocked case, EINVAL
does not seem the proper error code since the device is legit.
Powered by blists - more mailing lists