summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pechkin <mpech@cvs.openbsd.org>2002-03-08 11:06:18 +0000
committerMike Pechkin <mpech@cvs.openbsd.org>2002-03-08 11:06:18 +0000
commit67bc48572deefc6a3011b8c974cbea9b677a9fe5 (patch)
treef9c8ae5496c9a8d8d19ec3e168312abf2b68c4fc
parent3d00e0f93ff6235b005af68a9dd877c250d132d4 (diff)
Fix arc4random() usage; add more randomness to intvl_random().
millert@ ok
-rw-r--r--sbin/routed/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/routed/main.c b/sbin/routed/main.c
index a180aced785..31cf976f068 100644
--- a/sbin/routed/main.c
+++ b/sbin/routed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.13 2002/02/16 20:25:02 millert Exp $ */
+/* $OpenBSD: main.c,v 1.14 2002/03/08 11:06:17 mpech Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@ char copyright[] =
#if !defined(lint)
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.13 2002/02/16 20:25:02 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.14 2002/03/08 11:06:17 mpech Exp $";
#endif
#include "defs.h"
@@ -770,7 +770,7 @@ intvl_random(struct timeval *tp, /* put value here */
{
tp->tv_sec = (time_t)(hi == lo
? lo
- : (lo + arc4random() % ((hi - lo))));
+ : (lo + arc4random() % ((1 + hi - lo))));
tp->tv_usec = arc4random() % 1000000;
}