summaryrefslogtreecommitdiff
path: root/usr.sbin/rtsold
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2008-04-13 00:22:18 +0000
committerDamien Miller <djm@cvs.openbsd.org>2008-04-13 00:22:18 +0000
commitf15cc9e98f102b443a7b1bc97ce7b524d3453c7e (patch)
treecd34ef18f375e585b2843c566e08b7a49da49084 /usr.sbin/rtsold
parentdd3e3e68352b843aef5b3347835e71e9f26a0d92 (diff)
Use arc4random_buf() when requesting more than a single word of output
Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
Diffstat (limited to 'usr.sbin/rtsold')
-rw-r--r--usr.sbin/rtsold/rtsold.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index 4db48bfcdb6..a711cd27741 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsold.c,v 1.40 2008/01/05 17:03:09 chl Exp $ */
+/* $OpenBSD: rtsold.c,v 1.41 2008/04/13 00:22:17 djm Exp $ */
/* $KAME: rtsold.c,v 1.75 2004/01/03 00:00:07 itojun Exp $ */
/*
@@ -577,7 +577,8 @@ rtsol_timer_update(struct ifinfo *ifinfo)
ifinfo->timer = tm_max; /* stop timer(valid?) */
break;
case IFS_DELAY:
- interval = arc4random() % (MAX_RTR_SOLICITATION_DELAY * MILLION);
+ interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY *
+ MILLION);
ifinfo->timer.tv_sec = interval / MILLION;
ifinfo->timer.tv_usec = interval % MILLION;
break;