summaryrefslogtreecommitdiffstats
path: root/src/vlib/threads.c
diff options
context:
space:
mode:
authorEyal Bari <ebari@cisco.com>2018-11-25 15:42:47 +0200
committerDave Barach <openvpp@barachs.net>2018-11-25 15:30:13 +0000
commitce55bcde5d3e4d69af4b9bcd3e8f4c31732a8603 (patch)
treed52e101d8ec25a770283456c4929419598012897 /src/vlib/threads.c
parentc29a0ea6900672afe37a995fb2c18490074bb04a (diff)
vlib:init free list buffers vec
fixes a problem seen when dhcp proxy uses vlib_buffer_chain_linearize function which tries to vlib_buffer_alloc zero buffers - which succeeds if the buffers vector is initialized but otherwise crashes when trying to update the _vec_len in vlib_buffer_alloc_from_free_list solved by initializing the free_list buffers vec Change-Id: I1186d7aac05e54864d72f3f144e1bef8064f8efa Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/vlib/threads.c')
-rw-r--r--src/vlib/threads.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index fc2586c8967..3e184e3e1cd 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -882,6 +882,8 @@ start_workers (vlib_main_t * vm)
fl_clone[0] = fl_orig[0];
fl_clone->buffers = 0;
+ vec_validate(fl_clone->buffers, 0);
+ vec_reset_length(fl_clone->buffers);
fl_clone->n_alloc = 0;
}));
/* *INDENT-ON* */