From: Tom Herbert <tom@herbertland.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <kernel-team@fb.com>
Subject: [PATCH net-next 1/8] net: Checks skb_dst to be NULL in inet_iif
Date: Tue, 5 Apr 2016 08:22:49 -0700 [thread overview]
Message-ID: <1459869776-2090500-2-git-send-email-tom@herbertland.com> (raw)
In-Reply-To: <1459869776-2090500-1-git-send-email-tom@herbertland.com>
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 <tom@herbertland.com>
---
include/net/route.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/net/route.h b/include/net/route.h
index 9b0a523..f4b11ee 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -322,10 +322,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;
}
--
2.8.0.rc2
next prev parent reply other threads:[~2016-04-05 15:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 15:22 [PATCH net-next 0/8] udp: GRO in UDP sockets Tom Herbert
2016-04-05 15:22 ` Tom Herbert [this message]
2016-04-05 15:22 ` [PATCH net-next 2/8] udp: Add udp6_lib_lookup_skb and udp4_lib_lookup_skb Tom Herbert
2016-04-05 15:22 ` [PATCH net-next 3/8] udp: Add GRO functions to UDP socket Tom Herbert
2016-04-05 15:22 ` [PATCH net-next 4/8] udp: Add socket based GRO and config Tom Herbert
2016-04-05 15:22 ` [PATCH net-next 5/8] vxlan: change vxlan to use UDP socket GRO Tom Herbert
2016-04-05 15:22 ` [PATCH net-next 6/8] fou: change " Tom Herbert
2016-04-05 15:22 ` [PATCH net-next 7/8] geneve: " Tom Herbert
2016-04-05 15:22 ` [PATCH net-next 8/8] udp: Remove udp_offloads Tom Herbert
2016-04-07 20:54 ` [PATCH net-next 0/8] udp: GRO in UDP sockets David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459869776-2090500-2-git-send-email-tom@herbertland.com \
--to=tom@herbertland.com \
--cc=davem@davemloft.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).