]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/ip_sockglue.c
Merge remote-tracking branch 'wireless-next/master'
[karo-tx-linux.git] / net / ipv4 / ip_sockglue.c
index 56e34457ac070922ba7467f8c4fcba94d22827d7..0626f2cb192e69ecb3fdbcf6d4d12884c7bc5c6d 100644 (file)
@@ -1052,11 +1052,12 @@ e_inval:
  * destination in skb->cb[] before dst drop.
  * This way, receiver doesnt make cache line misses to read rtable.
  */
-void ipv4_pktinfo_prepare(struct sk_buff *skb)
+void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb)
 {
        struct in_pktinfo *pktinfo = PKTINFO_SKB_CB(skb);
 
-       if (skb_rtable(skb)) {
+       if ((inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO) &&
+           skb_rtable(skb)) {
                pktinfo->ipi_ifindex = inet_iif(skb);
                pktinfo->ipi_spec_dst.s_addr = fib_compute_spec_dst(skb);
        } else {