]> Pileus Git - ~andy/linux/blobdiff - drivers/net/tun.c
tuntap: initialize vlan_features
[~andy/linux] / drivers / net / tun.c
index b7c457adc0dc7439cc2a842409ed3871207f079b..316c759bd988e6d602e7ab7dae37022f46be9ffa 100644 (file)
@@ -409,14 +409,12 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
 {
        struct tun_file *ntfile;
        struct tun_struct *tun;
-       struct net_device *dev;
 
        tun = rtnl_dereference(tfile->tun);
 
        if (tun && !tfile->detached) {
                u16 index = tfile->queue_index;
                BUG_ON(index >= tun->numqueues);
-               dev = tun->dev;
 
                rcu_assign_pointer(tun->tfiles[index],
                                   tun->tfiles[tun->numqueues - 1]);
@@ -1205,6 +1203,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
        }
 
        skb_reset_network_header(skb);
+       skb_probe_transport_header(skb, 0);
+
        rxhash = skb_get_rxhash(skb);
        netif_rx_ni(skb);
 
@@ -1656,6 +1656,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->vlan_features = dev->features;
 
                INIT_LIST_HEAD(&tun->disabled);
                err = tun_attach(tun, file);