aboutsummaryrefslogtreecommitdiff
path: root/src/core/pipe.c
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/core/pipe.c
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/core/pipe.c')
-rw-r--r--src/core/pipe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/pipe.c b/src/core/pipe.c
index 249e887c..0633dea9 100644
--- a/src/core/pipe.c
+++ b/src/core/pipe.c
@@ -190,7 +190,7 @@ nni_pipe_start(nni_pipe *pipe)
// happen if we wrap -- i.e. we've had 4 billion or so pipes.
// XXX: consider making this a hash table!!
nni_pipe *check;
- pipe->p_id = nni_plat_nextid() & 0x7FFFFFFF;
+ pipe->p_id = nni_random() & 0x7FFFFFFF;
collide = 0;
NNI_LIST_FOREACH (&sock->s_pipes, check) {
if ((pipe != check) && (check->p_id == pipe->p_id)) {