Merge tag 'v3.10.70' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv4 / ip_sockglue.c
index f6603142cb33c7c2e211414c4f193835297f9fe5..a2ef76c45cd395e973ec4c17cd9c3bddadc956f1 100644 (file)
@@ -1042,6 +1042,13 @@ void ipv4_pktinfo_prepare(struct sk_buff *skb)
                pktinfo->ipi_ifindex = 0;
                pktinfo->ipi_spec_dst.s_addr = 0;
        }
+       /* We need to keep the dst for __ip_options_echo()
+        * We could restrict the test to opt.ts_needtime || opt.srr,
+        * but the following is good enough as IP options are not often used.
+        */
+       if (unlikely(IPCB(skb)->opt.optlen))
+               skb_dst_force(skb);
+       else
        skb_dst_drop(skb);
 }