summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-10-29 16:53:34 +0000
committerdelphij <delphij@FreeBSD.org>2015-10-29 16:53:34 +0000
commit73d04e0e3d8a68ad719134d40eb89a14bff4694e (patch)
tree810b6722357e4b14a7fe1799f71e3ea886cd8be5 /usr.sbin/rtadvd
parentec25e45f25b186456ac1e61b723961d214efca64 (diff)
downloadFreeBSD-src-73d04e0e3d8a68ad719134d40eb89a14bff4694e.zip
FreeBSD-src-73d04e0e3d8a68ad719134d40eb89a14bff4694e.tar.gz
MFC r288963:
Now that we own the code, use arc4random(3) unconditionally and remove the corresponding HAVE_ARC4RANDOM conditions.
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r--usr.sbin/rtadvd/Makefile2
-rw-r--r--usr.sbin/rtadvd/rtadvd.c17
2 files changed, 0 insertions, 19 deletions
diff --git a/usr.sbin/rtadvd/Makefile b/usr.sbin/rtadvd/Makefile
index d48832d..b5c3796 100644
--- a/usr.sbin/rtadvd/Makefile
+++ b/usr.sbin/rtadvd/Makefile
@@ -22,8 +22,6 @@ SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c timer_subr.c \
DPADD= ${LIBUTIL}
LDADD= -lutil
-CFLAGS+= -DHAVE_ARC4RANDOM
-
WARNS?= 1
.include <bsd.prog.mk>
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index 6554b61..16c21e6 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -242,14 +242,6 @@ main(int argc, char *argv[])
/* timer initialization */
rtadvd_timer_init();
-#ifndef HAVE_ARC4RANDOM
- /* random value initialization */
-#ifdef __FreeBSD__
- srandomdev();
-#else
- srandom((unsigned long)time(NULL));
-#endif
-#endif
pfh = pidfile_open(pidfilename, 0600, &otherpid);
if (pfh == NULL) {
if (errno == EEXIST)
@@ -1016,11 +1008,7 @@ set_short_delay(struct ifinfo *ifi)
* delay and send the advertisement at the
* already-scheduled time. RFC 4861 6.2.6
*/
-#ifdef HAVE_ARC4RANDOM
delay = arc4random_uniform(MAX_RA_DELAY_TIME);
-#else
- delay = random() % MAX_RA_DELAY_TIME;
-#endif
interval.tv_sec = 0;
interval.tv_nsec = delay * 1000;
rest = rtadvd_timer_rest(ifi->ifi_ra_timer);
@@ -1894,13 +1882,8 @@ ra_timer_update(void *arg, struct timespec *tm)
* MaxRtrAdvInterval (RFC4861 6.2.4).
*/
interval = rai->rai_mininterval;
-#ifdef HAVE_ARC4RANDOM
interval += arc4random_uniform(rai->rai_maxinterval -
rai->rai_mininterval);
-#else
- interval += random() % (rai->rai_maxinterval -
- rai->rai_mininterval);
-#endif
break;
case IFI_STATE_TRANSITIVE:
/*
OpenPOWER on IntegriCloud