summaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6.h
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.h
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.h')
-rw-r--r--sys/netinet6/nd6.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h
index d61d9c8af6b..fcc70b0054d 100644
--- a/sys/netinet6/nd6.h
+++ b/sys/netinet6/nd6.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.h,v 1.1 1999/12/08 06:50:23 itojun Exp $ */
+/* $OpenBSD: nd6.h,v 1.2 2000/01/08 04:49:22 deraadt Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -121,7 +121,7 @@ struct in6_ndireq {
#define MIN_RANDOM_FACTOR 512 /* 1024 * 0.5 */
#define MAX_RANDOM_FACTOR 1536 /* 1024 * 1.5 */
#define ND_COMPUTE_RTIME(x) \
- (((MIN_RANDOM_FACTOR * (x >> 10)) + (random() & \
+ (((MIN_RANDOM_FACTOR * (x >> 10)) + (arc4random() & \
((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10)))) /1000)
struct nd_defrouter {