summaryrefslogtreecommitdiffstats
path: root/net/sctp/input.c
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2016-07-13 20:08:58 +0200
committerDavid S. Miller <davem@davemloft.net>2016-07-14 03:10:14 +0200
commite7487c86dc5c4a528a7dbd9dc14f453a0de61a84 (patch)
treefee52720c9c4621d165294c8d48dff6326468c36 /net/sctp/input.c
parentsctp: allow GSO frags to access the chunk too (diff)
downloadlinux-e7487c86dc5c4a528a7dbd9dc14f453a0de61a84.tar.xz
linux-e7487c86dc5c4a528a7dbd9dc14f453a0de61a84.zip
sctp: avoid identifying address family many times for a chunk
Identifying address family operations during rx path is not something expensive but it's ugly to the eye to have it done multiple times, specially when we already validated it during initial rx processing. This patch takes advantage of the now shared sctp_input_cb and make the pointer to the operations readily available. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 7a327ff71f08..30d72f7707b6 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -140,6 +140,7 @@ int sctp_rcv(struct sk_buff *skb)
af = sctp_get_af_specific(family);
if (unlikely(!af))
goto discard_it;
+ SCTP_INPUT_CB(skb)->af = af;
/* Initialize local addresses for lookups. */
af->from_skb(&src, skb, 1);