summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/reass/ip4_sv_reass.c
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2020-12-15 21:47:36 +0100
committerDamjan Marion <dmarion@me.com>2020-12-16 09:42:33 +0000
commit53be16d053328941f4738d83385a9c19b2c3776a (patch)
treef17dc144dd62870672875e03a2e3e8dbf4cce01b /src/vnet/ip/reass/ip4_sv_reass.c
parentb61f3ccbc958cf43a44e62c93ce8126efaeeb037 (diff)
ip: fix possible missing trace indexes
Add safeguards when tracing packets to avoid cases where clear trace was issue while buffers were held in reassembly. Type: fix Change-Id: I1bdd1e629e8bc08ce63913fd3c4b2327e47dec04 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/vnet/ip/reass/ip4_sv_reass.c')
-rw-r--r--src/vnet/ip/reass/ip4_sv_reass.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/ip/reass/ip4_sv_reass.c b/src/vnet/ip/reass/ip4_sv_reass.c
index c74f8e5b661..e9582638047 100644
--- a/src/vnet/ip/reass/ip4_sv_reass.c
+++ b/src/vnet/ip/reass/ip4_sv_reass.c
@@ -235,6 +235,13 @@ ip4_sv_reass_add_trace (vlib_main_t * vm, vlib_node_runtime_t * node,
u32 ip_proto, u16 l4_src_port, u16 l4_dst_port)
{
vlib_buffer_t *b = vlib_get_buffer (vm, bi);
+ if (pool_is_free_index
+ (vm->trace_main.trace_buffer_pool, vlib_buffer_get_trace_index (b)))
+ {
+ // this buffer's trace is gone
+ b->flags &= ~VLIB_BUFFER_IS_TRACED;
+ return;
+ }
ip4_sv_reass_trace_t *t = vlib_add_trace (vm, node, b, sizeof (t[0]));
if (reass)
{