ipv4: Change rt->rt_iif encoding.

On input packet processing, rt->rt_iif will be zero if we should
use skb->dev->ifindex.

Since we access rt->rt_iif consistently via inet_iif(), that is
the only spot whose interpretation have to adjust.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2012-07-23 13:57:45 -07:00
parent b68581778c
commit 13378cad02
2 changed files with 9 additions and 5 deletions

View File

@@ -277,7 +277,11 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
static inline int inet_iif(const struct sk_buff *skb)
{
return skb_rtable(skb)->rt_iif;
int iif = skb_rtable(skb)->rt_iif;
if (iif)
return iif;
return skb->skb_iif;
}
extern int sysctl_ip_default_ttl;