From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org, Dan Winship <danw@redhat.com>
Subject: Re: [PATCH net v2] rtnetlink: always put ILFA_LINK for links with a link-netnsid
Date: Tue, 14 May 2019 09:32:32 +0200 [thread overview]
Message-ID: <65c8778c-9be9-c81f-5a9b-13e070ca38da@6wind.com> (raw)
In-Reply-To: <20190513214648.GA29270@bistromath.localdomain>
Le 13/05/2019 à 23:46, Sabrina Dubroca a écrit :
> 2019-05-13, 17:13:36 +0200, Nicolas Dichtel wrote:
>> Le 13/05/2019 à 17:08, Sabrina Dubroca a écrit :
>>> 2019-05-13, 16:50:51 +0200, Nicolas Dichtel wrote:
>>>> Le 13/05/2019 à 15:47, Sabrina Dubroca a écrit :
>>>>> Currently, nla_put_iflink() doesn't put the IFLA_LINK attribute when
>>>>> iflink == ifindex.
>>>>>
>>>>> In some cases, a device can be created in a different netns with the
>>>>> same ifindex as its parent. That device will not dump its IFLA_LINK
>>>>> attribute, which can confuse some userspace software that expects it.
>>>>> For example, if the last ifindex created in init_net and foo are both
>>>>> 8, these commands will trigger the issue:
>>>>>
>>>>> ip link add parent type dummy # ifindex 9
>>>>> ip link add link parent netns foo type macvlan # ifindex 9 in ns foo
>>>>>
>>>>> So, in case a device puts the IFLA_LINK_NETNSID attribute in a dump,
>>>>> always put the IFLA_LINK attribute as well.
>>>>>
>>>>> Thanks to Dan Winship for analyzing the original OpenShift bug down to
>>>>> the missing netlink attribute.
>>>>>
>>>>> Analyzed-by: Dan Winship <danw@redhat.com>
>>>>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>>>> I would say:
>>>> Fixes: 5e6700b3bf98 ("sit: add support of x-netns")
>>>>
>>>> Because before this patch, there was no device with an iflink that can be put in
>>>> another netns.
>>>
>>> That tells us how far back we might want to backport this fix, but not
>>> which commit introduced the bug. I think Fixes should refer to the
>>> introduction of the faulty code, not to what patch made it visible (if
>>> we can find both).
>> No sure to follow you. The problem you describe cannot happen before commit
>> 5e6700b3bf98, so there cannot be a "faulty" patch before that commit.
>
> What about macvlan devices?
>
> From commit b863ceb7ddce ("[NET]: Add macvlan driver"):
>
> static int macvlan_init(struct net_device *dev)
> {
> ...
> dev->iflink = lowerdev->ifindex;
> ...
> }
>
> vlan devices also had an iflink assigned since commit ddd7bf9fe4e5.
>
> What am I missing?
You miss the fact that netns have been introduced after both commits.
What about this one?
Fixes: d8a5ec672768 ("[NET]: netlink support for moving devices between network
namespaces.")
Regards,
Nicolas
next prev parent reply other threads:[~2019-05-14 7:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 13:47 [PATCH net v2] rtnetlink: always put ILFA_LINK for links with a link-netnsid Sabrina Dubroca
2019-05-13 14:50 ` Nicolas Dichtel
2019-05-13 15:08 ` Sabrina Dubroca
2019-05-13 15:13 ` Nicolas Dichtel
2019-05-13 21:46 ` Sabrina Dubroca
2019-05-14 7:32 ` Nicolas Dichtel [this message]
2019-05-14 8:01 ` Sabrina Dubroca
2019-05-14 10:05 ` Nicolas Dichtel
2019-05-14 10:24 ` Sabrina Dubroca
2019-05-14 12:10 ` Nicolas Dichtel
2019-05-13 16:19 ` David Miller
2019-05-13 15:07 ` David Ahern
2019-05-13 15:18 ` Nicolas Dichtel
2019-05-13 16:36 ` Stephen Hemminger
2019-05-13 16:38 ` David Ahern
2019-05-13 18:07 ` Edward Cree
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65c8778c-9be9-c81f-5a9b-13e070ca38da@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=danw@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sd@queasysnail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.