diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2019-05-14 15:12:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-14 15:40:01 -0700 |
commit | feadc4b6cf42a53a8a93c918a569a0b7e62bd350 (patch) | |
tree | 45440a7927d2c1506ca6bd752288bcfc09ac8773 /net/strparser | |
parent | 00f9fec48157f3734e52130a119846e67a12314b (diff) | |
download | linux-feadc4b6cf42a53a8a93c918a569a0b7e62bd350.tar.gz linux-feadc4b6cf42a53a8a93c918a569a0b7e62bd350.tar.bz2 linux-feadc4b6cf42a53a8a93c918a569a0b7e62bd350.zip |
rtnetlink: always put IFLA_LINK for links with a link-netnsid
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.
v2: change Fixes tag, it's been here forever, as Nicolas Dichtel said
add Nicolas' ack
v3: change Fixes tag
fix subject typo, spotted by Edward Cree
Analyzed-by: Dan Winship <danw@redhat.com>
Fixes: d8a5ec672768 ("[NET]: netlink support for moving devices between network namespaces.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/strparser')
0 files changed, 0 insertions, 0 deletions