* [PATCH net-next] tun: Consistently configure generic netdev params via rtnetlink
@ 2018-10-09 18:21 Serhey Popovych
2018-10-16 4:41 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Serhey Popovych @ 2018-10-09 18:21 UTC (permalink / raw)
To: netdev; +Cc: ebiederm
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>
---
drivers/net/tun.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index b174342..a3e8a43 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2298,6 +2298,8 @@ static void tun_setup(struct net_device *dev)
static int tun_validate(struct nlattr *tb[], struct nlattr *data[],
struct netlink_ext_ack *extack)
{
+ if (!data)
+ return 0;
return -EINVAL;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] tun: Consistently configure generic netdev params via rtnetlink
2018-10-09 18:21 [PATCH net-next] tun: Consistently configure generic netdev params via rtnetlink Serhey Popovych
@ 2018-10-16 4:41 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-10-16 4:41 UTC (permalink / raw)
To: serhe.popovych; +Cc: netdev, ebiederm
From: Serhey Popovych <serhe.popovych@gmail.com>
Date: Tue, 9 Oct 2018 21:21:01 +0300
> 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>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-16 12:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-09 18:21 [PATCH net-next] tun: Consistently configure generic netdev params via rtnetlink Serhey Popovych
2018-10-16 4:41 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).