vlib: fix adaptive mode flag unset on nodes reforking
The adaptive mode flag is being unset on
nodes reforking. The flag is copied in order
to avoid this issue.
Old flags are copied for all nodes.
Type: fix
Signed-off-by: Maxime Peim <mpeim@cisco.com>
Change-Id: Ic29b20fc0e4454ce4b3765c478f55bf650b4572a
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index c65460e..7c796f5 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -1101,6 +1101,7 @@
/* keep previous node state */
new_n_clone->state = old_n_clone->state;
+ new_n_clone->flags = old_n_clone->flags;
}
vec_add1 (nm_clone->nodes, new_n_clone);
new_n_clone++;
@@ -1132,6 +1133,7 @@
{
rt = vlib_node_get_runtime (vm_clone, old_rt[j].node_index);
rt->state = old_rt[j].state;
+ rt->flags = old_rt[j].flags;
clib_memcpy_fast (rt->runtime_data, old_rt[j].runtime_data,
VLIB_NODE_RUNTIME_DATA_SIZE);
}
@@ -1162,6 +1164,7 @@
{
rt = vlib_node_get_runtime (vm_clone, old_rt[j].node_index);
rt->state = old_rt[j].state;
+ rt->flags = old_rt[j].flags;
clib_memcpy_fast (rt->runtime_data, old_rt[j].runtime_data,
VLIB_NODE_RUNTIME_DATA_SIZE);
}
@@ -1189,6 +1192,7 @@
{
rt = vlib_node_get_runtime (vm_clone, old_rt[j].node_index);
rt->state = old_rt[j].state;
+ rt->flags = old_rt[j].flags;
clib_memcpy_fast (rt->runtime_data, old_rt[j].runtime_data,
VLIB_NODE_RUNTIME_DATA_SIZE);
}