From e2c411ce3c541e10f05006e9db5bde986a892b5d Mon Sep 17 00:00:00 2001 From: itojun Date: Sat, 6 Sep 2003 12:42:00 +0000 Subject: use arc4random --- usr.sbin/mrouted/main.c | 10 ++-------- usr.sbin/mrouted/prune.c | 8 ++------ 2 files changed, 4 insertions(+), 14 deletions(-) (limited to 'usr.sbin/mrouted') diff --git a/usr.sbin/mrouted/main.c b/usr.sbin/mrouted/main.c index 356181cfe22..fe08c5b9b32 100644 --- a/usr.sbin/mrouted/main.c +++ b/usr.sbin/mrouted/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.19 2003/05/16 18:10:38 itojun Exp $ */ +/* $NetBSD: main.c,v 1.20 2003/09/06 12:45:00 itojun Exp $ */ /* * The mrouted program is covered by the license in the accompanying file @@ -29,7 +29,7 @@ #include #ifndef lint -__RCSID("@(#) $NetBSD: main.c,v 1.19 2003/05/16 18:10:38 itojun Exp $"); +__RCSID("@(#) $NetBSD: main.c,v 1.20 2003/09/06 12:45:00 itojun Exp $"); #endif #include @@ -172,12 +172,6 @@ usage: fprintf(stderr, logit(LOG_NOTICE, 0, "%s", versionstring); -#ifdef SYSV - srand48(time(NULL)); -#else - srandom(gethostid()); -#endif - /* * Get generation id */ diff --git a/usr.sbin/mrouted/prune.c b/usr.sbin/mrouted/prune.c index 9a750112cf3..b9fdb3b1cfe 100644 --- a/usr.sbin/mrouted/prune.c +++ b/usr.sbin/mrouted/prune.c @@ -1,4 +1,4 @@ -/* $NetBSD: prune.c,v 1.14 2003/05/16 22:59:50 dsl Exp $ */ +/* $NetBSD: prune.c,v 1.15 2003/09/06 12:45:00 itojun Exp $ */ /* * The mrouted program is covered by the license in the accompanying file @@ -21,11 +21,7 @@ extern int phys_vif; /* * dither cache lifetime to obtain a value between x and 2*x */ -#ifdef SYSV -#define CACHE_LIFETIME(x) ((x) + (lrand48() % (x))) -#else -#define CACHE_LIFETIME(x) ((x) + (random() % (x))) -#endif +#define CACHE_LIFETIME(x) ((x) + (arc4random() % (x))) #define CHK_GS(x, y) { \ switch(x) { \ -- cgit