summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-08-05 22:40:58 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-08-05 22:40:58 +0000
commit9fe49dd5198bd4a239db52c52b299b4d735b581c (patch)
tree6d36faa1c11c47615e42f1e18e46867dd26c1352
parent602ff899e6275e1f240dcd6e5649db1c7127e131 (diff)
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.
-rw-r--r--sbin/isakmpd/isakmpd.c19
1 files 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"
@@ -65,11 +66,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);