From ce5b1f80d8ca7e29694f6540801ea9853fb7ddb6 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Fri, 30 Oct 2020 16:46:31 +0100 Subject: Fix potential crash in parsing unusual commands 'reset values all' and 'reset randoms all' commands were potentially causing some crash. This has been fixed. Change-Id: Idc2c4f7c90db73e7fdf9e8ef76b00ba956a0d854 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/cmd_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'VNFs/DPPD-PROX') diff --git a/VNFs/DPPD-PROX/cmd_parser.c b/VNFs/DPPD-PROX/cmd_parser.c index 00027c47..7d216ba8 100644 --- a/VNFs/DPPD-PROX/cmd_parser.c +++ b/VNFs/DPPD-PROX/cmd_parser.c @@ -709,7 +709,7 @@ static int parse_cmd_reset_randoms_all(const char *str, struct input *input) unsigned task_id, lcore_id = -1; while (prox_core_next(&lcore_id, 0) == 0) { for (task_id = 0; task_id < lcore_cfg[lcore_id].n_tasks_all; task_id++) { - if (!task_is_mode(lcore_id, task_id, "gen")) { + if (task_is_mode(lcore_id, task_id, "gen")) { struct task_base *tbase = lcore_cfg[lcore_id].tasks_all[task_id]; uint32_t n_rands = task_gen_get_n_randoms(tbase); @@ -730,7 +730,7 @@ static int parse_cmd_reset_values_all(const char *str, struct input *input) unsigned task_id, lcore_id = -1; while (prox_core_next(&lcore_id, 0) == 0) { for (task_id = 0; task_id < lcore_cfg[lcore_id].n_tasks_all; task_id++) { - if (!task_is_mode(lcore_id, task_id, "gen")) { + if (task_is_mode(lcore_id, task_id, "gen")) { struct task_base *tbase = lcore_cfg[lcore_id].tasks_all[task_id]; plog_info("Resetting values on core %d task %d\n", lcore_id, task_id); -- cgit 1.2.3-korg