diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-04 05:13:43 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-04 05:13:43 +0000 |
commit | ad83af41f01d76dbf1344abf6f2e97bceab1ed76 (patch) | |
tree | 848ad1501ac9e71b974abd7a6327ee00d2338a38 /usr.sbin/rtadvd/rtadvd.c | |
parent | aa088c3d1d47dfc43468a5ed3be93528795f3b5b (diff) |
use arc4random
Diffstat (limited to 'usr.sbin/rtadvd/rtadvd.c')
-rw-r--r-- | usr.sbin/rtadvd/rtadvd.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index e7474d47893..b49b08d1457 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtadvd.c,v 1.18 2002/05/29 14:34:05 itojun Exp $ */ +/* $OpenBSD: rtadvd.c,v 1.19 2002/06/04 05:13:42 itojun Exp $ */ /* $KAME: rtadvd.c,v 1.66 2002/05/29 14:18:36 itojun Exp $ */ /* @@ -206,9 +206,6 @@ main(argc, argv) /* timer initialization */ rtadvd_timer_init(); - /* random value initialization */ - srandom((u_long)time(NULL)); - /* get iflist block from kernel */ init_iflist(); @@ -809,7 +806,7 @@ rs_input(int len, struct nd_router_solicit *rs, * delay and send the advertisement at the * already-scheduled time. RFC-2461 6.2.6 */ - delay = random() % MAX_RA_DELAY_TIME; + delay = arc4random() % MAX_RA_DELAY_TIME; interval.tv_sec = 0; interval.tv_usec = delay; rest = rtadvd_timer_rest(ra->timer); @@ -1570,7 +1567,7 @@ ra_timer_update(void *data, struct timeval *tm) * MaxRtrAdvInterval (RFC2461 6.2.4). */ interval = rai->mininterval; - interval += random() % (rai->maxinterval - rai->mininterval); + interval += arc4random() % (rai->maxinterval - rai->mininterval); /* * For the first few advertisements (up to |