From 67bc48572deefc6a3011b8c974cbea9b677a9fe5 Mon Sep 17 00:00:00 2001 From: Mike Pechkin Date: Fri, 8 Mar 2002 11:06:18 +0000 Subject: Fix arc4random() usage; add more randomness to intvl_random(). millert@ ok --- sbin/routed/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sbin/routed') 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; } -- cgit v1.2.3