diff options
author | Bud Grise <griseb@cisco.com> | 2016-04-04 20:17:36 -0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2016-04-11 14:23:34 +0000 |
commit | 5ac4a0f76a4f871e6e330e038d297d2d1c4c4f38 (patch) | |
tree | ad57be062d8c5663e801bf5e5036dfab6e963515 /vlib | |
parent | 608d1edf745d29ff03fc39da7351a593bf11eb5b (diff) |
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>
Diffstat (limited to 'vlib')
-rw-r--r-- | vlib/vlib/threads.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c index 15eb959938e..970e4a55b34 100644 --- a/vlib/vlib/threads.c +++ b/vlib/vlib/threads.c @@ -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; |