net: Handle different key sizes between address families in flow cache
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / ip_output.c
index ccaaa851ab429ee48b0aa803fd5bf8edd5ee34ce..8c6563361ab538cd49cae7594d9d67bdb9b0c7e9 100644 (file)
@@ -122,6 +122,7 @@ static int ip_dev_loopback_xmit(struct sk_buff *newskb)
        newskb->pkt_type = PACKET_LOOPBACK;
        newskb->ip_summed = CHECKSUM_UNNECESSARY;
        WARN_ON(!skb_dst(newskb));
+       skb_dst_force(newskb);
        netif_rx_ni(newskb);
        return 0;
 }
@@ -204,9 +205,15 @@ static inline int ip_finish_output2(struct sk_buff *skb)
                skb = skb2;
        }
 
+       rcu_read_lock();
        neigh = dst_get_neighbour(dst);
-       if (neigh)
-               return neigh_output(neigh, skb);
+       if (neigh) {
+               int res = neigh_output(neigh, skb);
+
+               rcu_read_unlock();
+               return res;
+       }
+       rcu_read_unlock();
 
        if (net_ratelimit())
                printk(KERN_DEBUG "ip_finish_output2: No header cache and no neighbour!\n");