[lkml]   [2019]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.16 086/305] tun: Consistently configure generic netdev params via rtnetlink
3.16.63-rc1 review patch.  If anyone has any objections, please let me know.


From: Serhey Popovych <>

commit df52eab23d703142c766ac00bdb8db19d71238d0 upstream.

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 <>
Signed-off-by: David S. Miller <>
Signed-off-by: Ben Hutchings <>
drivers/net/tun.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1415,6 +1415,8 @@ static void tun_setup(struct net_device
static int tun_validate(struct nlattr *tb[], struct nlattr *data[])
+ if (!data)
+ return 0;
return -EINVAL;

 \ /
  Last update: 2019-02-03 15:01    [W:0.637 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site