Skip to contentSkip to conversation

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

PATCH In review Yaroslav Isakov 1 participant 2 messages Mar 16, 2017

Subsystems (3)
lore
Share & tools
lore
#1 lore raw
In reply to Yaroslav Isakov

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 <[email protected]>:

Quoted 24 lines

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

---
 drivers/net/tun.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/tun.c +2 -1
index 34cc3c5..cc88cd7 100644
@@ -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

#0 lore raw

PATCH 1/1 tun: fix inability to set offloads after disabling them via ethtool

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

---
 drivers/net/tun.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/tun.c +2 -0
index 34cc3c5..cc88cd7 100644
@@ -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;
Signature · 1 line
2.10.2