aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-08-30 16:20:12 +0200
committerDave Barach <openvpp@barachs.net>2019-09-30 16:35:15 +0000
commit5517bd34535e4ffffb838a835bb95ddcb77e2bba (patch)
tree278471ee254c8feeff479acb197e4f8ef3cfcd99 /src
parent328c08d603bb0a9956b82553f1691fd8a5a5de7d (diff)
vlib: fix old nodes vector overflow in refork
Type: fix Change-Id: I81c4cf0ce87288bb2d3c7b9f31e9419290d588b4 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vlib/threads.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index 49b6e811240..7454d5a18f3 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -1060,11 +1060,7 @@ vlib_worker_thread_node_refork (void)
clib_mem_alloc_no_fail (vec_len (nm->nodes) * sizeof (*new_n_clone));
for (j = 0; j < vec_len (nm->nodes); j++)
{
- vlib_node_t *old_n_clone;
- vlib_node_t *new_n;
-
- new_n = nm->nodes[j];
- old_n_clone = old_nodes_clone[j];
+ vlib_node_t *new_n = nm->nodes[j];
clib_memcpy_fast (new_n_clone, new_n, sizeof (*new_n));
/* none of the copied nodes have enqueue rights given out */
@@ -1080,6 +1076,7 @@ vlib_worker_thread_node_refork (void)
}
else
{
+ vlib_node_t *old_n_clone = old_nodes_clone[j];
/* Copy stats if the old data is valid */
clib_memcpy_fast (&new_n_clone->stats_total,
&old_n_clone->stats_total,