Skip to content

Commit 0340d0b

Browse files
tomratbertdavem330
authored andcommitted
net: Checks skb_dst to be NULL in inet_iif
In inet_iif check if skb_rtable is NULL for the skb and return skb->skb_iif if it is. This change allows inet_iif to be called before the dst information has been set in the skb (e.g. when doing socket based UDP GRO). Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1fbbe1a commit 0340d0b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/net/route.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,11 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
322322

323323
static inline int inet_iif(const struct sk_buff *skb)
324324
{
325-
int iif = skb_rtable(skb)->rt_iif;
325+
struct rtable *rt = skb_rtable(skb);
326+
327+
if (rt && rt->rt_iif)
328+
return rt->rt_iif;
326329

327-
if (iif)
328-
return iif;
329330
return skb->skb_iif;
330331
}
331332

0 commit comments

Comments
 (0)