Commit e6277430 authored by Jesse Gross's avatar Jesse Gross Committed by Luis Henriques

udptunnel: Add SKB_GSO_UDP_TUNNEL during gro_complete.

commit cfdf1e1b upstream.

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: default avatarJesse Gross <jesse@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Cc: Ben Hutchings <ben@decadent.org.uk>
[ luis: backported to 3.16:
  - dropped changes to net/ipv4/fou.c
  - inlined call to udp_tunnel_gro_complete() in drivers/net/vxlan.c ]
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 2dd2c68e
...@@ -618,10 +618,15 @@ static int vxlan_gro_complete(struct sk_buff *skb, int nhoff) ...@@ -618,10 +618,15 @@ static int vxlan_gro_complete(struct sk_buff *skb, int nhoff)
{ {
struct ethhdr *eh; struct ethhdr *eh;
struct packet_offload *ptype; struct packet_offload *ptype;
struct udphdr *uh;
__be16 type; __be16 type;
int vxlan_len = sizeof(struct vxlanhdr) + sizeof(struct ethhdr); int vxlan_len = sizeof(struct vxlanhdr) + sizeof(struct ethhdr);
int err = -ENOSYS; int err = -ENOSYS;
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;
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment