From c5b5bd910507520f7974a156a1de9d187f23bc2f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 8 Jan 2017 15:28:37 -0800 Subject: New ISAAC pRNG. This replaces other local hacks for random data. Platforms must seed the pRNGs by offering an nni_plat_seed_prng() routine. Implementations for POSIX using various options (including the /dev/urandom device) are supplied. --- src/protocol/reqrep/req.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/protocol/reqrep') diff --git a/src/protocol/reqrep/req.c b/src/protocol/reqrep/req.c index 3c3bba9c..5b9671f8 100644 --- a/src/protocol/reqrep/req.c +++ b/src/protocol/reqrep/req.c @@ -58,7 +58,7 @@ nni_req_sock_init(void **reqp, nni_sock *sock) return (rv); } // this is "semi random" start for request IDs. - req->nextid = (nni_clock() >> 32) ^ (nni_clock() & 0xffffffff); + req->nextid = nni_random(); req->retry = NNI_SECOND * 60; req->sock = sock; req->reqmsg = NULL; -- cgit v1.2.3-70-g09d2