summaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6_nbr.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-01-08 04:49:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-01-08 04:49:23 +0000
commit2016a99ce5ca99a6be308b191605c6f6535b5d74 (patch)
tree38b1c77bf214620037183c0579713c192e267baf /sys/netinet6/nd6_nbr.c
parenta651700ddcde2cae5be144af6f6bf2c71b2caf85 (diff)
use arc4random() instead of random for two reasons.
1) on some architectures, random() should only be used by the scheduler (ie. statintr() because it is uniformly distributed 2) arc4random() is actually strong, random() is not at all
Diffstat (limited to 'sys/netinet6/nd6_nbr.c')
-rw-r--r--sys/netinet6/nd6_nbr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index d525fb37702..444548e60fd 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.5 1999/12/15 07:08:00 itojun Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.6 2000/01/08 04:49:22 deraadt Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -937,9 +937,9 @@ nd6_dad_start(ifa, tick)
int ntick;
if (*tick == 0)
- ntick = random() % (MAX_RTR_SOLICITATION_DELAY * hz);
+ ntick = arc4random() % (MAX_RTR_SOLICITATION_DELAY * hz);
else
- ntick = *tick + random() % (hz / 2);
+ ntick = *tick + arc4random() % (hz / 2);
*tick = ntick;
timeout((void (*) __P((void *)))nd6_dad_timer, (void *)ifa,
ntick);