From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yaroslav Isakov Subject: [PATCH] tun: fix inability to set offloads after disabling them via ethtool Date: Thu, 16 Mar 2017 22:44:10 +0300 Message-ID: <58caeb36.0a212e0a.87e63.3119@mx.google.com> To: netdev@vger.kernel.org Return-path: Received: from mail-lf0-f65.google.com ([209.85.215.65]:35111 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751960AbdCPTo5 (ORCPT ); Thu, 16 Mar 2017 15:44:57 -0400 Received: by mail-lf0-f65.google.com with SMTP id v2so4104002lfi.2 for ; Thu, 16 Mar 2017 12:44:55 -0700 (PDT) Received: from gmail.com (ppp109-252-59-36.pppoe.spdop.ru. [109.252.59.36]) by smtp.gmail.com with ESMTPSA id h10sm527291ljh.59.2017.03.16.12.44.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Mar 2017 12:44:54 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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