public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Yaroslav Isakov <yaroslav.isakov@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH] tun: fix inability to set offloads after disabling them via ethtool
Date: Thu, 16 Mar 2017 22:44:10 +0300	[thread overview]
Message-ID: <58caeb36.0a212e0a.87e63.3119@mx.google.com> (raw)

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>
---
 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

             reply	other threads:[~2017-03-16 19:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 19:44 Yaroslav Isakov [this message]
2017-03-21 22:31 ` [PATCH] tun: fix inability to set offloads after disabling them via ethtool David Miller
  -- strict thread matches above, loose matches on Subject: below --
2017-03-16 18:08 Yaroslav Isakov
2017-03-16 19:42 ` Yaroslav Isakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58caeb36.0a212e0a.87e63.3119@mx.google.com \
    --to=yaroslav.isakov@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox