]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
tun: fix inability to set offloads after disabling them via ethtool
authorYaroslav Isakov <yaroslav.isakov@gmail.com>
Thu, 16 Mar 2017 19:44:10 +0000 (22:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2017 22:30:59 +0000 (15:30 -0700)
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 <yaroslav.isakov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c

index 34cc3c590aa5c5c49509159d8fbf0f0cfcfca988..cc88cd7856f5e5ec4d3e3e309cbefe196c5b27ec 100644 (file)
@@ -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;