From eaa83c0439c13b76525224267c23d0cf52a6668b Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Thu, 2 Jun 2022 15:18:54 -0500 Subject: [PATCH] ipfix-export: Fix frame leak in flow_report_process_send() The flow_report_process_send() function always allocates a frame. However, when no template_send is needed, template_bi is ~0. When this happens, no vectors are placed in the frame. When the frame is then "put", a check for n_vectors == 0 prevents the frame from actually being placed back on the free list. Fix that by using a direct call to vlib_frame_free() when there are no frame vctors. Type: fix Signed-off-by: Jon Loeliger Change-Id: I936b5cea4cb3c358247c3d2e1a77d034a322ea76 --- src/vnet/ipfix-export/flow_report.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vnet/ipfix-export/flow_report.c b/src/vnet/ipfix-export/flow_report.c index 9d21d8b046d..cf23ccd7815 100644 --- a/src/vnet/ipfix-export/flow_report.c +++ b/src/vnet/ipfix-export/flow_report.c @@ -479,7 +479,15 @@ flow_report_process_send (vlib_main_t *vm, flow_report_main_t *frm, nf = fr->flow_data_callback (frm, exp, fr, nf, to_next, next_node); if (nf) - vlib_put_frame_to_node (vm, next_node, nf); + { + if (nf->n_vectors) + vlib_put_frame_to_node (vm, next_node, nf); + else + { + vlib_node_runtime_t *rt = vlib_node_get_runtime (vm, next_node); + vlib_frame_free (vm, rt, nf); + } + } } static uword -- 2.16.6