[PATCH] tun: fix inability to set offloads after disabling them via ethtool

Subsystems: networking drivers, the rest, tun/tap driver

DORMANTno replies

2 messages, 1 author, 2017-03-16 · open the first message on its own page

[PATCH] tun: fix inability to set offloads after disabling them via ethtool

From: Yaroslav Isakov <hidden>
Date: 2017-03-16 19:47:35

Added missing logic in tun driver, which prevents apps to set
offloads using tun ioctl, if offloads were previously disabled via ethtool

Signed-of-by: Yaroslav Isakov (yaroslav.isakov@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 34cc3c5..cc88cd7 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1931,6 +1931,8 @@ static int set_offload(struct tun_struct *tun, unsigned long arg)
 		return -EINVAL;
 
 	tun->set_features = features;
+	tun->dev->wanted_features &= ~TUN_USER_FEATURES;
+	tun->dev->wanted_features |= features;
 	netdev_update_features(tun->dev);
 
 	return 0;
-- 
2.10.2

Re: [PATCH] tun: fix inability to set offloads after disabling them via ethtool

From: Yaroslav Isakov <hidden>
Date: 2017-03-16 19:43:03

Sorry for spamming mailing list, forgot to check via checkpatch.pl,
will resend it one more time

2017-03-16 21:08 GMT+03:00 Yaroslav Isakov [off-list ref]:
quoted hunk
Added missing logic in tun driver, which prevents apps to set
offloads using tun ioctl, if offloads were previously disabled via ethtool

Signed-of-by: Yaroslav Isakov (yaroslav.isakov@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 34cc3c5..cc88cd7 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1931,6 +1931,8 @@ static int set_offload(struct tun_struct *tun, unsigned long arg)
                return -EINVAL;

        tun->set_features = features;
+       tun->dev->wanted_features &= ~TUN_USER_FEATURES;
+       tun->dev->wanted_features |= features;
        netdev_update_features(tun->dev);

        return 0;
--
2.10.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help