diff options
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/net/route.h b/include/net/route.h index 6de665bf1..ad777d79a 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -325,10 +325,11 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable static inline int inet_iif(const struct sk_buff *skb) { - int iif = skb_rtable(skb)->rt_iif; + struct rtable *rt = skb_rtable(skb); + + if (rt && rt->rt_iif) + return rt->rt_iif; - if (iif) - return iif; return skb->skb_iif; } |