ipsec: fix debug assert with ipv6 checksum offload 50/43050/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 28 May 2025 12:09:45 +0000 (14:09 +0200)
committerMohammed HAWARI <momohawari@gmail.com>
Mon, 2 Jun 2025 08:40:30 +0000 (08:40 +0000)
Since adding ASSERT() for checksum offload flags we need to make sure
the relevant flags are set before calling vnet_buffer_offload_flags_set()

Type: fix
Fixes: 7e00099480ab4d2c9353b8b5ed8d516e33abdd24

Change-Id: I521ae77f1d2e6a73deef5168473dd3e857257101
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/vnet/ipsec/esp_encrypt.c

index 1f2cc24..a56f2a2 100644 (file)
@@ -592,9 +592,9 @@ set_ip6_udp_cksum_offload (vlib_buffer_t *b, i16 l3_hdr_offset,
 {
   vnet_buffer (b)->l3_hdr_offset = l3_hdr_offset;
   vnet_buffer (b)->l4_hdr_offset = l4_hdr_offset;
-  vnet_buffer_offload_flags_set (b, VNET_BUFFER_OFFLOAD_F_UDP_CKSUM);
   b->flags |= (VNET_BUFFER_F_IS_IP6 | VNET_BUFFER_F_L3_HDR_OFFSET_VALID |
               VNET_BUFFER_F_L4_HDR_OFFSET_VALID);
+  vnet_buffer_offload_flags_set (b, VNET_BUFFER_OFFLOAD_F_UDP_CKSUM);
 }
 
 always_inline uword