diff options
author | Alexey Kodanev <alexey.kodanev@oracle.com> | 2017-10-06 19:02:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-08 10:12:15 -0700 |
commit | 3d0241d57c7b25bb75ac9d7a62753642264fdbce (patch) | |
tree | 536ca01291bd131be75fed6742557d1885774622 /net/ipv4/udp_offload.c | |
parent | a69518cf0b4cbf02c6bc1239cdeb8750a9eb8077 (diff) | |
download | linux-stable-3d0241d57c7b25bb75ac9d7a62753642264fdbce.tar.gz linux-stable-3d0241d57c7b25bb75ac9d7a62753642264fdbce.tar.bz2 linux-stable-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/udp_offload.c')
-rw-r--r-- | net/ipv4/udp_offload.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index 97658bfc1b58..e360d55be555 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -120,7 +120,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb, * will be using a length value equal to only one MSS sized * segment instead of the entire frame. */ - if (gso_partial) { + if (gso_partial && skb_is_gso(skb)) { uh->len = htons(skb_shinfo(skb)->gso_size + SKB_GSO_CB(skb)->data_offset + skb->head - (unsigned char *)uh); |