]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tun: Consistently configure generic netdev params via rtnetlink
authorSerhey Popovych <serhe.popovych@gmail.com>
Tue, 9 Oct 2018 18:21:01 +0000 (21:21 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:56:26 +0000 (19:56 -0600)
commite8f44273a3356c510bac9545064970e0567871b4
tree5d56e2b70f5096fdf840fae45c2000b1ed704a8b
parent265d0fbc78f449b65bbc4c02a110710a76bb9c4f
tun: Consistently configure generic netdev params via rtnetlink

BugLink: https://bugs.launchpad.net/bugs/1836802
[ Upstream commit df52eab23d703142c766ac00bdb8db19d71238d0 ]

Configuring generic network device parameters on tun will fail in
presence of IFLA_INFO_KIND attribute in IFLA_LINKINFO nested attribute
since tun_validate() always return failure.

This can be visualized with following ip-link(8) command sequences:

  # ip link set dev tun0 group 100
  # ip link set dev tun0 group 100 type tun
  RTNETLINK answers: Invalid argument

with contrast to dummy and veth drivers:

  # ip link set dev dummy0 group 100
  # ip link set dev dummy0 type dummy

  # ip link set dev veth0 group 100
  # ip link set dev veth0 group 100 type veth

Fix by returning zero in tun_validate() when @data is NULL that is
always in case since rtnl_link_ops->maxtype is zero in tun driver.

Fixes: f019a7a594d9 ("tun: Implement ip link del tunXXX")
Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/tun.c