From ad83af41f01d76dbf1344abf6f2e97bceab1ed76 Mon Sep 17 00:00:00 2001 From: Jun-ichiro itojun Hagino Date: Tue, 4 Jun 2002 05:13:43 +0000 Subject: use arc4random --- usr.sbin/rtadvd/rtadvd.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'usr.sbin/rtadvd/rtadvd.c') 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 -- cgit v1.2.3