diff options
author | Jesse Gross <jesse@nicira.com> | 2014-11-10 14:45:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-10 15:09:45 -0500 |
commit | cfdf1e1ba5bf55e095cf4bcaa9585c4759f239e8 (patch) | |
tree | 6844467a4be67dcc20519696ec9cee87556d779a /include/net | |
parent | 10b450cbbcb385d297a3c759b2e10da0c850011a (diff) |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/udp_tunnel.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h index a47790bcaa38..2a50a70ef587 100644 --- a/include/net/udp_tunnel.h +++ b/include/net/udp_tunnel.h | |||
@@ -100,6 +100,15 @@ static inline struct sk_buff *udp_tunnel_handle_offloads(struct sk_buff *skb, | |||
100 | return iptunnel_handle_offloads(skb, udp_csum, type); | 100 | return iptunnel_handle_offloads(skb, udp_csum, type); |
101 | } | 101 | } |
102 | 102 | ||
103 | static inline void udp_tunnel_gro_complete(struct sk_buff *skb, int nhoff) | ||
104 | { | ||
105 | struct udphdr *uh; | ||
106 | |||
107 | uh = (struct udphdr *)(skb->data + nhoff - sizeof(struct udphdr)); | ||
108 | skb_shinfo(skb)->gso_type |= uh->check ? | ||
109 | SKB_GSO_UDP_TUNNEL_CSUM : SKB_GSO_UDP_TUNNEL; | ||
110 | } | ||
111 | |||
103 | static inline void udp_tunnel_encap_enable(struct socket *sock) | 112 | static inline void udp_tunnel_encap_enable(struct socket *sock) |
104 | { | 113 | { |
105 | #if IS_ENABLED(CONFIG_IPV6) | 114 | #if IS_ENABLED(CONFIG_IPV6) |