summaryrefslogtreecommitdiff
path: root/sys/netatalk
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2008-04-18 06:42:22 +0000
committerDamien Miller <djm@cvs.openbsd.org>2008-04-18 06:42:22 +0000
commitadd7cd1933b616a68b7facc7786f42ec7a011711 (patch)
tree33825c4d3f64a10ef8ddd0dcbfcdec520535f008 /sys/netatalk
parentd9c80fcabe39b1183981cf36eb50ed872990f399 (diff)
use arc4random_uniform() for random number requests that are not a
power of two. use arc4random_bytes() when requesting more than a word of PRNG output. ok deraadt@
Diffstat (limited to 'sys/netatalk')
-rw-r--r--sys/netatalk/at_control.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c
index 04c4a1f1d3d..4dea1123ddd 100644
--- a/sys/netatalk/at_control.c
+++ b/sys/netatalk/at_control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: at_control.c,v 1.11 2007/10/01 16:39:30 krw Exp $ */
+/* $OpenBSD: at_control.c,v 1.12 2008/04/18 06:42:20 djm Exp $ */
/*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -379,7 +379,7 @@ at_ifinit( ifp, aa, sat )
if ( sat->sat_addr.s_net == ATADDR_ANYNET ) {
if ( nnets != 1 ) {
net = ntohs( nr.nr_firstnet ) +
- arc4random() % ( nnets - 1 );
+ arc4random_uniform( nnets - 1 );
} else {
net = ntohs( nr.nr_firstnet );
}