[Devel] [PATCH RH7 v2] net: tun: don't loose NETIF_F_VIRTUAL device feature

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Jun 16 03:02:23 PDT 2015


move setting NETIF_F_VIRTUAL from tun_setup to tun_set_iff
where other features are set, as tun_setup is only called in
tun_set_iff

https://jira.sw.ru/browse/PSBM-34066

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 drivers/net/tun.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 9c57c11..614dabb 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1437,7 +1437,6 @@ static void tun_setup(struct net_device *dev)
 
 	dev->ethtool_ops = &tun_ethtool_ops;
 	dev->destructor = tun_free_netdev;
-	dev->features |= NETIF_F_VIRTUAL;
 }
 
 /* Trivial set of netlink ops to allow deleting tun or tap
@@ -1701,7 +1700,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 
 		dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST |
 			TUN_USER_FEATURES;
-		dev->features = dev->hw_features;
+		dev->features = dev->hw_features | NETIF_F_VIRTUAL;
 		dev->vlan_features = dev->features;
 
 		INIT_LIST_HEAD(&tun->disabled);
-- 
1.9.3




More information about the Devel mailing list