From 9fe49dd5198bd4a239db52c52b299b4d735b581c Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Thu, 5 Aug 1999 22:40:58 +0000 Subject: Merge with EOM 1.36 author: niklas regrand is in util.h now. Use new conf_reinit API at SIGHUP time. Fix timeout handling in deteerministic mode. --- sbin/isakmpd/isakmpd.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sbin/isakmpd/isakmpd.c b/sbin/isakmpd/isakmpd.c index f33424a7c06..3adb13327be 100644 --- a/sbin/isakmpd/isakmpd.c +++ b/sbin/isakmpd/isakmpd.c @@ -1,5 +1,5 @@ -/* $OpenBSD: isakmpd.c,v 1.12 1999/07/07 22:11:45 niklas Exp $ */ -/* $EOM: isakmpd.c,v 1.35 1999/06/26 23:30:38 ho Exp $ */ +/* $OpenBSD: isakmpd.c,v 1.13 1999/08/05 22:40:57 niklas Exp $ */ +/* $EOM: isakmpd.c,v 1.36 1999/08/05 15:01:20 niklas Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -53,6 +53,7 @@ #include "transport.h" #include "udp.h" #include "ui.h" +#include "util.h" #ifdef USE_KEYNOTE #include "policy.h" @@ -64,11 +65,6 @@ */ int debug = 0; -/* - * Use -r seed to initalize random numbers to a deterministic sequence. - */ -extern int regrand; - /* * If we receive a SIGHUP signal, this flag gets set to show we need to * reconfigure ASAP. @@ -166,8 +162,12 @@ reinit (void) * XXX This means we discard exchange->last_msg, is this really ok? */ + /* Reinitialize PRNG if we are in deterministic mode. */ + if (regrand) + srandom (strtoul (optarg, 0, 0)); + /* Reread config file. */ - conf_init (); + conf_reinit (); #ifdef USE_KEYNOTE /* Reread the policies. */ @@ -254,7 +254,7 @@ main (int argc, char *argv[]) fd_set *rfds, *wfds; int n, m; size_t mask_size; - struct timeval tv, *timeout = &tv; + struct timeval tv, *timeout; parse_args (argc, argv); init (); @@ -324,6 +324,7 @@ main (int argc, char *argv[]) n = m; /* Find out when the next timed event is. */ + timeout = &tv; timer_next_event (&timeout); n = select (n, rfds, wfds, 0, timeout); -- cgit v1.2.3