summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtsold
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-10-06 23:42:58 +0000
committerdelphij <delphij@FreeBSD.org>2015-10-06 23:42:58 +0000
commit4ba30d91494662c0c17326df30fee38261f9d6ce (patch)
treec66679f47f5b5ea09b5747129b834b5ab09052b3 /usr.sbin/rtsold
parent4437aff4a8f03ebd6cfe0319fd468338e7affe5e (diff)
downloadFreeBSD-src-4ba30d91494662c0c17326df30fee38261f9d6ce.zip
FreeBSD-src-4ba30d91494662c0c17326df30fee38261f9d6ce.tar.gz
Now that we own the code, use arc4random(3) unconditionally
and remove the corresponding HAVE_ARC4RANDOM conditions. MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/rtsold')
-rw-r--r--usr.sbin/rtsold/Makefile1
-rw-r--r--usr.sbin/rtsold/rtsold.c8
2 files changed, 0 insertions, 9 deletions
diff --git a/usr.sbin/rtsold/Makefile b/usr.sbin/rtsold/Makefile
index caef62c..84cf0b2 100644
--- a/usr.sbin/rtsold/Makefile
+++ b/usr.sbin/rtsold/Makefile
@@ -20,6 +20,5 @@ MLINKS= rtsold.8 rtsol.8
SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c
WARNS?= 3
-CFLAGS+= -DHAVE_ARC4RANDOM
.include <bsd.prog.mk>
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index 18621bd..85ee133 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -214,10 +214,6 @@ main(int argc, char **argv)
errx(1, "pid filename (%s) must be an absolute path",
pidfilename);
}
-#ifndef HAVE_ARC4RANDOM
- /* random value initialization */
- srandom((u_long)time(NULL));
-#endif
#if (__FreeBSD_version < 900000)
if (Fflag) {
@@ -725,11 +721,7 @@ rtsol_timer_update(struct ifinfo *ifi)
ifi->timer = tm_max; /* stop timer(valid?) */
break;
case IFS_DELAY:
-#ifndef HAVE_ARC4RANDOM
- interval = random() % (MAX_RTR_SOLICITATION_DELAY * MILLION);
-#else
interval = arc4random_uniform(MAX_RTR_SOLICITATION_DELAY * MILLION);
-#endif
ifi->timer.tv_sec = interval / MILLION;
ifi->timer.tv_nsec = (interval % MILLION) * 1000;
break;
OpenPOWER on IntegriCloud