From cf1e8c1eeab1dc07d69210f410a086d7ae4eae90 Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Fri, 28 Jan 2022 13:16:46 +0000 Subject: ip: fix length calculation in ip6-receive Replace unconditional usage of buffer->total_length_not_including_first_buffer with a logic checking whether that length is set to a valid value. Type: fix Fixes: 17478e4eb81d384f171ca27c9110a051cd434f16 Signed-off-by: Klement Sekera Change-Id: I161d0957d62cc23826edd821aa5560bcfc5c1a33 --- src/vnet/ip/ip6_forward.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vnet') diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c index 5b7704e460e..ce165e0e2e4 100644 --- a/src/vnet/ip/ip6_forward.c +++ b/src/vnet/ip/ip6_forward.c @@ -1276,7 +1276,7 @@ ip6_tcp_udp_icmp_bad_length (vlib_main_t * vm, vlib_buffer_t * p0) } n_bytes_left -= n_this_buffer; - n_bytes_left -= p0->total_length_not_including_first_buffer; + n_bytes_left -= vlib_buffer_length_in_chain (vm, p0) - p0->current_length; if (n_bytes_left == 0) return 0; -- cgit 1.2.3-korg