Subject: Re: What are the intended semantics of IFLA_LINK_NETNSID?

From: Nicolas Dichtel <[email-masked]>
Date: Thu, 26 Feb 2015 15:52:40 +0100

Le 26/02/2015 14:48, Eric W. Biederman a écrit :
> Nicolas Dichtel <[email-masked]> writes:
[snip]
>> The interface is first created in link_net and moved at the end in dest_net.
>>
>> IP tunnels interfaces (ipip, sit, ip6_tunnels, gre[v6]) does not use src_net,
>
> I am pretty certain that is simply something that was overlooked when
> cross network namespace support was added to those network device types.
> Right now I would be surprised if anything in userspace cares, so we can
> probably just change those device types to look at src_net from newlink.
At least, depending of the interface type, the behavior is not the same. Thus,
making all interfaces consistent seems good.

>
> Certainly for our sanity in maintaining rtnl_newlink finding a way to
> make that change would be preferable.  Even if we ultimately have to add
> a flag that says only make src_net different from dev->net when
> IFLA_LINK_NETNSID is passed.
A flag is probably not needed, it's just a matter of passing src_net through
the functions that create the tunnel device.

>
> As making that change allows much more consistency in the code and
> allows us to get rid of an unnecessary dev_change_net_namespace.
Yes, I add this dev_change_net_namespace() to be independant of the interface
implementation (and thus beeing consistent whatever the interface type is used).

Nicolas