diff options
author | Jakub Kicinski <kuba@kernel.org> | 2020-11-12 16:54:48 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-12 16:54:48 -0800 |
commit | e1d9d7b91302593d1951fcb12feddda6fb58a3c0 (patch) | |
tree | 25662dfcceb84414d66f6c90714883b1542c0ea5 /net/ipv6/udp_offload.c | |
parent | e865802357086b36632acf3e629f726f089a6769 (diff) | |
parent | db7c953555388571a96ed8783ff6c5745ba18ab9 (diff) | |
download | linux-e1d9d7b91302593d1951fcb12feddda6fb58a3c0.tar.gz linux-e1d9d7b91302593d1951fcb12feddda6fb58a3c0.tar.bz2 linux-e1d9d7b91302593d1951fcb12feddda6fb58a3c0.zip |
Merge https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6/udp_offload.c')
-rw-r--r-- | net/ipv6/udp_offload.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index aa602af8e49d..c7bd7b1a04c1 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c @@ -111,12 +111,22 @@ out: return segs; } +static struct sock *udp6_gro_lookup_skb(struct sk_buff *skb, __be16 sport, + __be16 dport) +{ + const struct ipv6hdr *iph = skb_gro_network_header(skb); + + return __udp6_lib_lookup(dev_net(skb->dev), &iph->saddr, sport, + &iph->daddr, dport, inet6_iif(skb), + inet6_sdif(skb), &udp_table, NULL); +} + INDIRECT_CALLABLE_SCOPE struct sk_buff *udp6_gro_receive(struct list_head *head, struct sk_buff *skb) { struct udphdr *uh = udp_gro_udphdr(skb); + struct sock *sk = NULL; struct sk_buff *pp; - struct sock *sk; if (unlikely(!uh)) goto flush; @@ -135,7 +145,10 @@ struct sk_buff *udp6_gro_receive(struct list_head *head, struct sk_buff *skb) skip: NAPI_GRO_CB(skb)->is_ipv6 = 1; rcu_read_lock(); - sk = static_branch_unlikely(&udpv6_encap_needed_key) ? udp6_lib_lookup_skb(skb, uh->source, uh->dest) : NULL; + + if (static_branch_unlikely(&udpv6_encap_needed_key)) + sk = udp6_gro_lookup_skb(skb, uh->source, uh->dest); + pp = udp_gro_receive(head, skb, uh, sk); rcu_read_unlock(); return pp; |