Skip to content

Commit 25ec5de

Browse files
Julian Anastasovgregkh
Julian Anastasov
authored andcommitted
ipv4: return valid RTA_IIF on ip route get
[ Upstream commit 9114615 ] Extend commit 13378ca ("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 <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2089f73 commit 25ec5de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,7 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
23642364
}
23652365
} else
23662366
#endif
2367-
if (nla_put_u32(skb, RTA_IIF, rt->rt_iif))
2367+
if (nla_put_u32(skb, RTA_IIF, skb->dev->ifindex))
23682368
goto nla_put_failure;
23692369
}
23702370

0 commit comments

Comments
 (0)