From: Aloys Augustin Date: Thu, 24 Feb 2022 15:44:23 +0000 (+0000) Subject: ip: fix assert in ip4_ttl_inc X-Git-Tag: v22.10-rc0~263 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=0b77e312827f68251f10ac1f674e3e564059fc52;p=vpp.git ip: fix assert in ip4_ttl_inc There is no need to verify the checksum for packets that have the IP checksum offload flag set. This uses the same logic as ip4_ttl_and_checksum_check. Type: fix Signed-off-by: Aloys Augustin Change-Id: I177b07212a992362a4c965c074dcecf1e504c593 --- diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c index 3c67bb3d4e7..3556d357f50 100644 --- a/src/vnet/ip/ip4_forward.c +++ b/src/vnet/ip/ip4_forward.c @@ -2055,7 +2055,9 @@ ip4_ttl_inc (vlib_buffer_t * b, ip4_header_t * ip) ttl += 1; ip->ttl = ttl; - ASSERT (ip4_header_checksum_is_valid (ip)); + ASSERT (ip4_header_checksum_is_valid (ip) || + (vnet_buffer (b)->oflags & VNET_BUFFER_OFFLOAD_F_IP_CKSUM) || + (vnet_buffer (b)->oflags & VNET_BUFFER_OFFLOAD_F_OUTER_IP_CKSUM)); } /* Decrement TTL & update checksum.