Skip to content

Commit

Permalink
DAOS-13717 client: use d_rand() to generate random number (#12418)
Browse files Browse the repository at this point in the history
d_rand() helper use lrand48_r() internally which is more secure.
Fixed CID: 1404393

Signed-off-by: Wang Shilong <[email protected]>
  • Loading branch information
wangshilong authored Jun 19, 2023
1 parent 6b429a5 commit f1cd992
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/api/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f1cd992

Please sign in to comment.