import PULS_20180308
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv4 / ip_sockglue.c
index 23e6ab0a2dc0ea070b6a86548b7761f7dbda00d4..1c688f7403f709f35b8b96e9393d34c9df51eaa5 100644 (file)
@@ -1046,6 +1046,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);
 }