diff options
| author | itojun <itojun@NetBSD.org> | 2003-09-06 12:42:00 +0000 |
|---|---|---|
| committer | itojun <itojun@NetBSD.org> | 2003-09-06 12:42:00 +0000 |
| commit | e2c411ce3c541e10f05006e9db5bde986a892b5d (patch) | |
| tree | 97ce7f50a6df5bb15af8564e2874869180d7c474 /usr.sbin/mrouted | |
| parent | b548db68460d059054081e4d142993a1d162dbe0 (diff) | |
use arc4random
Diffstat (limited to 'usr.sbin/mrouted')
| -rw-r--r-- | usr.sbin/mrouted/main.c | 10 | ||||
| -rw-r--r-- | usr.sbin/mrouted/prune.c | 8 |
2 files changed, 4 insertions, 14 deletions
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 <sys/cdefs.h> #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 <err.h> @@ -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) { \ |
