Propagate the VLIB_FRAME_NO_FREE_AFTER_DISPATCH flag to cloned next_frames
Without this, frames can be double-freed to nodes like "error-punt", leading to buffer leaks and other problems. Change-Id: Ie28a4f504254ee439f720dbaac7f12206cea753b Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
This commit is contained in:
Bud Grise
committed by
Gerrit Code Review
parent
608d1edf74
commit
5ac4a0f76a
@ -631,10 +631,13 @@ static clib_error_t * start_workers (vlib_main_t * vm)
|
||||
{
|
||||
vlib_next_frame_t *nf = &nm_clone->next_frames[j];
|
||||
u32 save_node_runtime_index;
|
||||
u32 save_flags;
|
||||
|
||||
save_node_runtime_index = nf->node_runtime_index;
|
||||
save_flags = nf->flags & VLIB_FRAME_NO_FREE_AFTER_DISPATCH;
|
||||
vlib_next_frame_init (nf);
|
||||
nf->node_runtime_index = save_node_runtime_index;
|
||||
nf->flags = save_flags;
|
||||
}
|
||||
|
||||
/* fork the frame dispatch queue */
|
||||
@ -843,10 +846,13 @@ void vlib_worker_thread_node_runtime_update(void)
|
||||
{
|
||||
vlib_next_frame_t *nf = &nm_clone->next_frames[j];
|
||||
u32 save_node_runtime_index;
|
||||
u32 save_flags;
|
||||
|
||||
save_node_runtime_index = nf->node_runtime_index;
|
||||
save_flags = nf->flags & VLIB_FRAME_NO_FREE_AFTER_DISPATCH;
|
||||
vlib_next_frame_init (nf);
|
||||
nf->node_runtime_index = save_node_runtime_index;
|
||||
nf->flags = save_flags;
|
||||
}
|
||||
|
||||
old_nodes_clone = nm_clone->nodes;
|
||||
|
Reference in New Issue
Block a user