mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 13:51:52 +00:00
udptunnel: Add SKB_GSO_UDP_TUNNEL during gro_complete.
When doing GRO processing for UDP tunnels, we never add SKB_GSO_UDP_TUNNEL to gso_type - only the type of the inner protocol is added (such as SKB_GSO_TCPV4). The result is that if the packet is later resegmented we will do GSO but not treat it as a tunnel. This results in UDP fragmentation of the outer header instead of (i.e.) TCP segmentation of the inner header as was originally on the wire. Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
10b450cbbc
commit
cfdf1e1ba5
3 changed files with 13 additions and 0 deletions
|
@ -621,6 +621,8 @@ static int vxlan_gro_complete(struct sk_buff *skb, int nhoff)
|
||||||
int vxlan_len = sizeof(struct vxlanhdr) + sizeof(struct ethhdr);
|
int vxlan_len = sizeof(struct vxlanhdr) + sizeof(struct ethhdr);
|
||||||
int err = -ENOSYS;
|
int err = -ENOSYS;
|
||||||
|
|
||||||
|
udp_tunnel_gro_complete(skb, nhoff);
|
||||||
|
|
||||||
eh = (struct ethhdr *)(skb->data + nhoff + sizeof(struct vxlanhdr));
|
eh = (struct ethhdr *)(skb->data + nhoff + sizeof(struct vxlanhdr));
|
||||||
type = eh->h_proto;
|
type = eh->h_proto;
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,15 @@ static inline struct sk_buff *udp_tunnel_handle_offloads(struct sk_buff *skb,
|
||||||
return iptunnel_handle_offloads(skb, udp_csum, type);
|
return iptunnel_handle_offloads(skb, udp_csum, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void udp_tunnel_gro_complete(struct sk_buff *skb, int nhoff)
|
||||||
|
{
|
||||||
|
struct udphdr *uh;
|
||||||
|
|
||||||
|
uh = (struct udphdr *)(skb->data + nhoff - sizeof(struct udphdr));
|
||||||
|
skb_shinfo(skb)->gso_type |= uh->check ?
|
||||||
|
SKB_GSO_UDP_TUNNEL_CSUM : SKB_GSO_UDP_TUNNEL;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void udp_tunnel_encap_enable(struct socket *sock)
|
static inline void udp_tunnel_encap_enable(struct socket *sock)
|
||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_IPV6)
|
#if IS_ENABLED(CONFIG_IPV6)
|
||||||
|
|
|
@ -133,6 +133,8 @@ static int fou_gro_complete(struct sk_buff *skb, int nhoff)
|
||||||
int err = -ENOSYS;
|
int err = -ENOSYS;
|
||||||
const struct net_offload **offloads;
|
const struct net_offload **offloads;
|
||||||
|
|
||||||
|
udp_tunnel_gro_complete(skb, nhoff);
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
|
offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
|
||||||
ops = rcu_dereference(offloads[proto]);
|
ops = rcu_dereference(offloads[proto]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue