summaryrefslogtreecommitdiffstats
path: root/net/ipv4/gre_offload.c
diff options
context:
space:
mode:
authorAlexey Kodanev2017-10-06 18:02:35 +0200
committerDavid S. Miller2017-10-08 19:12:15 +0200
commit3d0241d57c7b25bb75ac9d7a62753642264fdbce (patch)
tree536ca01291bd131be75fed6742557d1885774622 /net/ipv4/gre_offload.c
parentmlxsw: spectrum_router: Avoid expensive lookup during route removal (diff)
downloadkernel-qcow2-linux-3d0241d57c7b25bb75ac9d7a62753642264fdbce.tar.gz
kernel-qcow2-linux-3d0241d57c7b25bb75ac9d7a62753642264fdbce.tar.xz
kernel-qcow2-linux-3d0241d57c7b25bb75ac9d7a62753642264fdbce.zip
gso: fix payload length when gso_size is zero
When gso_size reset to zero for the tail segment in skb_segment(), later in ipv6_gso_segment(), __skb_udp_tunnel_segment() and gre_gso_segment() we will get incorrect results (payload length, pcsum) for that segment. inet_gso_segment() already has a check for gso_size before calculating payload. The issue was found with LTP vxlan & gre tests over ixgbe NIC. Fixes: 07b26c9454a2 ("gso: Support partial splitting at the frag_list pointer") Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com> Acked-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/gre_offload.c')
-rw-r--r--net/ipv4/gre_offload.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index 416bb304a281..1859c473b21a 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -86,7 +86,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
greh = (struct gre_base_hdr *)skb_transport_header(skb);
pcsum = (__sum16 *)(greh + 1);
- if (gso_partial) {
+ if (gso_partial && skb_is_gso(skb)) {
unsigned int partial_adj;
/* Adjust checksum to account for the fact that