From 9330521cb8e181a5061917d22506c67edc410e3b Mon Sep 17 00:00:00 2001 From: Kiran Kumar K Date: Fri, 15 May 2020 12:58:24 +0530 Subject: [PATCH] test/graph: use better randomness Fix weak crypto issues reported by Coverity. Fixes: 6b89650418 ("test/graph: add functional tests") Signed-off-by: Kiran Kumar K Acked-by: Jerin Jacob --- app/test/test_graph.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test/test_graph.c b/app/test/test_graph.c index cf6df0744c..dfb71b44d2 100644 --- a/app/test/test_graph.c +++ b/app/test/test_graph.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "test.h" @@ -145,7 +146,7 @@ uint16_t test_node_worker_source(struct rte_graph *graph, struct rte_node *node, void **objs, uint16_t nb_objs) { - uint32_t obj_node0 = rand() % 100, obj_node1; + uint32_t obj_node0 = rte_rand() % 100, obj_node1; test_main_t *tm = &test_main; struct rte_mbuf *data; void **next_stream; @@ -193,7 +194,7 @@ test_node0_worker(struct rte_graph *graph, struct rte_node *node, void **objs, test_main_t *tm = &test_main; if (*(uint32_t *)node->ctx == test_node0.id) { - uint32_t obj_node0 = rand() % 100, obj_node1; + uint32_t obj_node0 = rte_rand() % 100, obj_node1; struct rte_mbuf *data; uint8_t second_pass = 0; uint32_t count = 0; -- 2.20.1