diff mbox series

[ovs-dev,v6,2/3] userspace: Correct IPv6 header in software-GSO.

Message ID 20240117142124.241050-2-mkp@redhat.com
State Accepted
Commit 76e2f20d53d381eff7a01b13add337f1750c9fe0
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev,v6,1/3] dp-packet: Set checksum flags during software TSO. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation fail test: fail

Commit Message

Mike Pattrick Jan. 17, 2024, 2:21 p.m. UTC
Correct the length field in IPv6 packets when applying software fallback
GSO. Previosuly the field retained an IPv4 header size, which was
incorrect.

Signed-off-by: Mike Pattrick <mkp@redhat.com>
Fixes: 8b5fe2dc6080 ("userspace: Add Generic Segmentation Offloading.")
---
v6: include ip6 extensions
---
 lib/dp-packet-gso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Jan. 17, 2024, 7:46 p.m. UTC | #1
On Wed, Jan 17, 2024 at 09:21:23AM -0500, Mike Pattrick wrote:
> Correct the length field in IPv6 packets when applying software fallback
> GSO. Previosuly the field retained an IPv4 header size, which was
> incorrect.
> 
> Signed-off-by: Mike Pattrick <mkp@redhat.com>
> Fixes: 8b5fe2dc6080 ("userspace: Add Generic Segmentation Offloading.")
> ---
> v6: include ip6 extensions

Acked-by: Simon Horman <horms@ovn.org>
diff mbox series

Patch

diff --git a/lib/dp-packet-gso.c b/lib/dp-packet-gso.c
index e2c141b32..847685ad9 100644
--- a/lib/dp-packet-gso.c
+++ b/lib/dp-packet-gso.c
@@ -142,7 +142,7 @@  dp_packet_gso(struct dp_packet *p, struct dp_packet_batch **batches)
             struct ovs_16aligned_ip6_hdr *ip6_hdr = dp_packet_l3(seg);
 
             ip6_hdr->ip6_ctlun.ip6_un1.ip6_un1_plen
-                = htons(sizeof *ip_hdr + dp_packet_l4_size(seg));
+                = htons(dp_packet_l3_size(seg) - sizeof *ip6_hdr);
         }
 
         /* Update L4 header. */