aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorAloys Augustin <aloaugus@cisco.com>2022-02-24 15:44:23 +0000
committerBeno�t Ganne <bganne@cisco.com>2022-03-18 08:25:11 +0000
commit0b77e312827f68251f10ac1f674e3e564059fc52 (patch)
tree78aa06d74d41d2f585e09b8b9fb2fb404fe81a71 /src/vnet
parent19658c990b9514b4e42e9a6aeb93116a6213c148 (diff)
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 <aloaugus@cisco.com> Change-Id: I177b07212a992362a4c965c074dcecf1e504c593
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/ip/ip4_forward.c4
1 files changed, 3 insertions, 1 deletions
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.