net: loopback: fix a dst refcounting issue
[pandora-kernel.git] / drivers / net / loopback.c
index d70fb76..d0893e4 100644 (file)
@@ -78,6 +78,11 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,
 
        skb_orphan(skb);
 
+       /* Before queueing this packet to netif_rx(),
+        * make sure dst is refcounted.
+        */
+       skb_dst_force(skb);
+
        skb->protocol = eth_type_trans(skb, dev);
 
        /* it's OK to use per_cpu_ptr() because BHs are off */
@@ -174,7 +179,8 @@ static void loopback_setup(struct net_device *dev)
                | NETIF_F_HIGHDMA
                | NETIF_F_LLTX
                | NETIF_F_NETNS_LOCAL
-               | NETIF_F_VLAN_CHALLENGED;
+               | NETIF_F_VLAN_CHALLENGED
+               | NETIF_F_LOOPBACK;
        dev->ethtool_ops        = &loopback_ethtool_ops;
        dev->header_ops         = &eth_header_ops;
        dev->netdev_ops         = &loopback_ops;