Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[~shefty/rdma-dev.git] / drivers / net / tun.c
index dcd0c19a431e1dc7c982b38bd1deff0aa9b38280..f042b0373e5ddec6a8a85703843b89a43cbeb1f7 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);
 
@@ -1663,6 +1663,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);