summaryrefslogtreecommitdiff
path: root/usr.sbin/sasyncd/carp.c
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2006-09-01 01:13:26 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2006-09-01 01:13:26 +0000
commit20975bad116829cb66dcc32a951ca71e7c4dc108 (patch)
tree48f39a3b8da063d418ee10a7bfdc9e1c289ba586 /usr.sbin/sasyncd/carp.c
parent50bb55282c7b6fe248bae95ae189f300b9e9dc4e (diff)
Teach sasyncd to set isakmpd into active or passive mode, according
to our current carp state. Based on a diff by ho@. OK ho@, hshoexer@, deraadt@
Diffstat (limited to 'usr.sbin/sasyncd/carp.c')
-rw-r--r--usr.sbin/sasyncd/carp.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/sasyncd/carp.c b/usr.sbin/sasyncd/carp.c
index 32151a2037b..06b35b4c309 100644
--- a/usr.sbin/sasyncd/carp.c
+++ b/usr.sbin/sasyncd/carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: carp.c,v 1.5 2006/06/02 20:31:48 moritz Exp $ */
+/* $OpenBSD: carp.c,v 1.6 2006/09/01 01:13:25 mpf Exp $ */
/*
* Copyright (c) 2005 Håkan Olsson. All rights reserved.
@@ -41,6 +41,7 @@
#include <string.h>
#include <unistd.h>
+#include "monitor.h"
#include "sasyncd.h"
int carp_demoted = 0;
@@ -170,6 +171,7 @@ carp_update_state(enum RUNSTATE current_state)
cfgstate.runstate = current_state;
if (current_state == MASTER)
pfkey_set_promisc();
+ isakmpd_setrun();
net_ctl_update_state();
}
}
@@ -252,3 +254,16 @@ carp_init(void)
return 0;
}
+
+/* Enable or disable isakmpd connection checker. */
+void
+isakmpd_setrun(void)
+{
+ if (cfgstate.runstate == MASTER) {
+ if (monitor_isakmpd_active(1))
+ log_msg(0, "failed to activate isakmpd");
+ } else {
+ if (monitor_isakmpd_active(0))
+ log_msg(0, "failed to passivate isakmpd");
+ }
+}