]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
geneve: fix length used in GRO hint UDP checksum adjustment
authorAntoine Tenart <atenart@kernel.org>
Fri, 29 May 2026 14:47:00 +0000 (16:47 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 4 Jun 2026 08:48:46 +0000 (10:48 +0200)
In geneve_post_decap_hint the length used for adjusting the UDP checksum
should be 'skb->len - gro_hint->nested_tp_offset' (UDP length) instead
of 'skb->len - gro_hint->nested_nh_offset' (IP length).

Fixes: fd0dd796576e ("geneve: use GRO hint option in the RX path")
Cc: Paolo Abeni <pabeni@redhat.com>
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260521131436.748832-1-jhs%40mojatatu.com
Signed-off-by: Antoine Tenart <atenart@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260529144713.780938-1-atenart@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/geneve.c

index c6563367d38266933e91929530fcd5fdd5ce8849..715180c3a1b34ef436292941107a7ded95bfcb00 100644 (file)
@@ -632,7 +632,7 @@ static int geneve_post_decap_hint(const struct sock *sk, struct sk_buff *skb,
        uh = udp_hdr(skb);
        uh->len = htons(skb->len - gro_hint->nested_tp_offset);
        if (uh->check) {
-               len = skb->len - gro_hint->nested_nh_offset;
+               len = skb->len - gro_hint->nested_tp_offset;
                skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL_CSUM;
                if (gro_hint->nested_is_v6)
                        uh->check = ~udp_v6_check(len, &ipv6h->saddr,