aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/survey
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-08 15:28:37 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-08 17:33:05 -0800
commitc5b5bd910507520f7974a156a1de9d187f23bc2f (patch)
tree9766716c795d88fe902c7196696c1389d76717ba /src/protocol/survey
parent4b166dd8ae417b818a5ba214d8f2e648ac1d5be9 (diff)
downloadnng-c5b5bd910507520f7974a156a1de9d187f23bc2f.tar.gz
nng-c5b5bd910507520f7974a156a1de9d187f23bc2f.tar.bz2
nng-c5b5bd910507520f7974a156a1de9d187f23bc2f.zip
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.
Diffstat (limited to 'src/protocol/survey')
-rw-r--r--src/protocol/survey/survey.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/protocol/survey/survey.c b/src/protocol/survey/survey.c
index cb600dc3..9def9292 100644
--- a/src/protocol/survey/survey.c
+++ b/src/protocol/survey/survey.c
@@ -54,8 +54,7 @@ nni_surv_sock_init(void **sp, nni_sock *nsock)
return (rv);
}
NNI_LIST_INIT(&psock->pipes, nni_surv_pipe, node);
- // this is "semi random" start for request IDs.
- psock->nextid = (nni_clock() >> 32) ^ (nni_clock() & 0xffffffff);
+ psock->nextid = nni_random();
psock->nsock = nsock;
psock->raw = 0;
psock->survtime = NNI_SECOND * 60;