[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7c8880b4-86a0-c4b0-4b92-136b2ab790db@6wind.com>
Date: Tue, 14 May 2019 12:05:16 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Sabrina Dubroca <sd@...asysnail.net>
Cc: netdev@...r.kernel.org, Dan Winship <danw@...hat.com>
Subject: Re: [PATCH net v2] rtnetlink: always put ILFA_LINK for links with a
link-netnsid
Le 14/05/2019 à 10:01, Sabrina Dubroca a écrit :
> 2019-05-14, 09:32:32 +0200, Nicolas Dichtel wrote:
[snip]
>> What about this one?
>> Fixes: d8a5ec672768 ("[NET]: netlink support for moving devices between network
>> namespaces.")
>
> Nice. Now I think the bug can't really trigger unless one of these
> commits are present:
>
> aa79e66eee5d ("net: Make ifindex generation per-net namespace")
> 9c7dafbfab15 ("net: Allow to create links with given ifindex")
>
I don't think so.
Please have a look to commit ce286d327341 ("[NET]: Implement network device
movement between namespaces").
In dev_change_net_namespace(), there is the following code:
/* If there is an ifindex conflict assign a new one */
if (__dev_get_by_index(net, dev->ifindex)) {
int iflink = (dev->iflink == dev->ifindex);
dev->ifindex = dev_new_index(net);
if (iflink)
dev->iflink = dev->ifindex;
}
This code may change the ifindex of an interface when this interface moves to
another netns. This may happen even before the commits you propose, because the
global ifindex counter can wrap around.
Regards,
Nicolas
Powered by blists - more mailing lists