summaryrefslogtreecommitdiff
path: root/src/starter/invokecharon.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2009-10-21 11:14:02 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2009-10-21 11:14:02 +0000
commit7410d3c6d6a9a1cd7aa55083c938946af6ff9498 (patch)
tree3291beffa55649f9be28b4a98a7d503d334fbcf2 /src/starter/invokecharon.c
parent41787e147279ff0695e9d759487266a60b80867b (diff)
downloadvyos-strongswan-7410d3c6d6a9a1cd7aa55083c938946af6ff9498.tar.gz
vyos-strongswan-7410d3c6d6a9a1cd7aa55083c938946af6ff9498.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.3.4)
Diffstat (limited to 'src/starter/invokecharon.c')
-rw-r--r--src/starter/invokecharon.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/starter/invokecharon.c b/src/starter/invokecharon.c
index 804467cea..1eb2a0332 100644
--- a/src/starter/invokecharon.c
+++ b/src/starter/invokecharon.c
@@ -36,18 +36,28 @@
static int _charon_pid = 0;
static int _stop_requested;
-pid_t
-starter_charon_pid(void)
+pid_t starter_charon_pid(void)
{
return _charon_pid;
}
-void
-starter_charon_sigchild(pid_t pid)
+void starter_charon_sigchild(pid_t pid, int status)
{
- if (pid == _charon_pid)
+ if (pid == _charon_pid)
{
- _charon_pid = 0;
+ _charon_pid = 0;
+ if (status == SS_RC_LIBSTRONGSWAN_INTEGRITY ||
+ status == SS_RC_DAEMON_INTEGRITY)
+ {
+ plog("charon has quit: integrity test of %s failed",
+ (status == 64) ? "libstrongswan" : "charon");
+ _stop_requested = 1;
+ }
+ else if (status == SS_RC_INITIALIZATION_FAILED)
+ {
+ plog("charon has quit: initialization failed");
+ _stop_requested = 1;
+ }
if (!_stop_requested)
{
plog("charon has died -- restart scheduled (%dsec)"
@@ -58,8 +68,7 @@ starter_charon_sigchild(pid_t pid)
}
}
-int
-starter_stop_charon (void)
+int starter_stop_charon (void)
{
int i;
pid_t pid = _charon_pid;
@@ -106,8 +115,7 @@ starter_stop_charon (void)
}
-int
-starter_start_charon (starter_config_t *cfg, bool no_fork, bool attach_gdb)
+int starter_start_charon (starter_config_t *cfg, bool no_fork, bool attach_gdb)
{
struct stat stb;
int pid, i;