diff mbox series

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

Message ID 20240116205216.180510-2-mkp@redhat.com
State Superseded
Headers show
Series [ovs-dev,v5,1/3] dp-packet: Set checksum flags during software TSO. | expand

Checks

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

Commit Message

Mike Pattrick Jan. 16, 2024, 8:52 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>
---
 lib/dp-packet-gso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilya Maximets Jan. 16, 2024, 8:58 p.m. UTC | #1
On 1/16/24 21:52, 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>
> ---
>  lib/dp-packet-gso.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/dp-packet-gso.c b/lib/dp-packet-gso.c
> index e2c141b32..b0fd2f1d1 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_l4_size(seg));

Payload length should include all the extension headers.
I'm not sure these are part of l4_size.  Likely, they are not.

>          }
>  
>          /* Update L4 header. */
diff mbox series

Patch

diff --git a/lib/dp-packet-gso.c b/lib/dp-packet-gso.c
index e2c141b32..b0fd2f1d1 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_l4_size(seg));
         }
 
         /* Update L4 header. */