ipv4: return valid RTA_IIF on ip route get
authorJulian Anastasov <ja@ssi.bg>
Sun, 13 Apr 2014 15:08:02 +0000 (18:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Apr 2014 03:23:41 +0000 (23:23 -0400)
Extend commit 13378cad02afc2adc6c0e07fca03903c7ada0b37
("ipv4: Change rt->rt_iif encoding.") from 3.6 to return valid
RTA_IIF on 'ip route get ... iif DEVICE' instead of rt_iif 0
which is displayed as 'iif *'.

inet_iif is not appropriate to use because skb_iif is not set.
Use the skb->dev->ifindex instead.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c

index 34d094cadb11a3ef9b8351140e9c0ae4d60a4d1e..20a59c388e6eb678c4f642cfd1284287a7aab083 100644 (file)
@@ -2357,7 +2357,7 @@ static int rt_fill_info(struct net *net,  __be32 dst, __be32 src,
                        }
                } else
 #endif
-                       if (nla_put_u32(skb, RTA_IIF, rt->rt_iif))
+                       if (nla_put_u32(skb, RTA_IIF, skb->dev->ifindex))
                                goto nla_put_failure;
        }