From: Yaroslav Isakov Date: Thu, 16 Mar 2017 19:44:10 +0000 (+0300) Subject: tun: fix inability to set offloads after disabling them via ethtool X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=09050957fae896e001498af1aa35c446a11cb47d;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Yaroslav Isakov Signed-off-by: David S. Miller --- diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 34cc3c590aa5..cc88cd7856f5 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;