From f1cd992db125c6291d45a8e62444ff434dc7c154 Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Mon, 19 Jun 2023 22:36:59 +0800 Subject: [PATCH] DAOS-13717 client: use d_rand() to generate random number (#12418) d_rand() helper use lrand48_r() internally which is more secure. Fixed CID: 1404393 Signed-off-by: Wang Shilong --- src/client/api/rpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/api/rpc.c b/src/client/api/rpc.c index b198152784f..fefb4dbf4fe 100644 --- a/src/client/api/rpc.c +++ b/src/client/api/rpc.c @@ -163,7 +163,7 @@ daos_rpc_proto_query(crt_opcode_t base_opc, uint32_t *ver_array, int count, int } num_ranks = dc_mgmt_net_get_num_srv_ranks(); - rproto->ep.ep_rank = rand() % num_ranks; + rproto->ep.ep_rank = d_rand() % num_ranks; rproto->ver_array = ver_array; rproto->array_size = count; rproto->ep.ep_grp = sys->sy_group;