diff options
author | ache <ache@FreeBSD.org> | 2008-07-26 15:46:39 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2008-07-26 15:46:39 +0000 |
commit | ce16c85534e6c6620f9c2302b74e815644d86243 (patch) | |
tree | 6700e6d72c026d0320cd1ed5e497f6cee2b296b6 /usr.sbin/rtsold | |
parent | 0ef9f80522d5f076cc7a56941504743353add9ba (diff) | |
download | FreeBSD-src-ce16c85534e6c6620f9c2302b74e815644d86243.zip FreeBSD-src-ce16c85534e6c6620f9c2302b74e815644d86243.tar.gz |
Change arc4random to arc4random_uniform since modulo is not power of 2,
as OpenBSD does.
Obtained from: OpenBSD
Diffstat (limited to 'usr.sbin/rtsold')
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 82d5eaf..f0493fbd 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -683,7 +683,7 @@ rtsol_timer_update(struct ifinfo *ifinfo) #ifndef HAVE_ARC4RANDOM interval = random() % (MAX_RTR_SOLICITATION_DELAY * MILLION); #else - interval = arc4random() % (MAX_RTR_SOLICITATION_DELAY * MILLION); + interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION); #endif ifinfo->timer.tv_sec = interval / MILLION; ifinfo->timer.tv_usec = interval % MILLION; |