summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip6_forward.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2022-01-28 13:16:46 +0000
committerOle Tr�an <otroan@employees.org>2022-01-31 14:58:36 +0000
commitcf1e8c1eeab1dc07d69210f410a086d7ae4eae90 (patch)
tree4b4b6dc7e44ea7f0475f8f6ab5b8dc6b727489bd /src/vnet/ip/ip6_forward.c
parent3a1a86f87fd7d9c84ad4b12124c50fc3927ec6cf (diff)
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 <ksekera@cisco.com> Change-Id: I161d0957d62cc23826edd821aa5560bcfc5c1a33
Diffstat (limited to 'src/vnet/ip/ip6_forward.c')
-rw-r--r--src/vnet/ip/ip6_forward.c2
1 files changed, 1 insertions, 1 deletions
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;