summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2014-11-10 11:45:13 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-21 09:23:07 -0800
commit0fee76308e4193dc38412e7ff7e7b7e369b91fb5 (patch)
tree844a513f59cd76c93d14a34ca271a4dcec5d04a5 /include
parent64fd58eb83e87feb32a248c01301418e51b0609c (diff)
udptunnel: Add SKB_GSO_UDP_TUNNEL during gro_complete.
[ Upstream commit cfdf1e1ba5bf55e095cf4bcaa9585c4759f239e8 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/udp_tunnel.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
index ffd69cbded35..55003b84e2e1 100644
--- a/include/net/udp_tunnel.h
+++ b/include/net/udp_tunnel.h
@@ -26,6 +26,15 @@ struct udp_port_cfg {
use_udp6_rx_checksums:1;
};
+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;
+}
+
int udp_sock_create(struct net *net, struct udp_port_cfg *cfg,
struct socket **sockp);