aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/sa/child_sa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/sa/child_sa.c')
-rw-r--r--src/charon/sa/child_sa.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/charon/sa/child_sa.c b/src/charon/sa/child_sa.c
index 58c9d5543..29454dd95 100644
--- a/src/charon/sa/child_sa.c
+++ b/src/charon/sa/child_sa.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006-2008 Tobias Brunner
- * Copyright (C) 2005-2007 Martin Willi
+ * Copyright (C) 2005-2008 Martin Willi
* Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -26,12 +26,13 @@
#include <daemon.h>
-ENUM(child_sa_state_names, CHILD_CREATED, CHILD_DELETING,
+ENUM(child_sa_state_names, CHILD_CREATED, CHILD_DESTROYING,
"CREATED",
"ROUTED",
"INSTALLED",
"REKEYING",
"DELETING",
+ "DESTROYING",
);
typedef struct sa_policy_t sa_policy_t;
@@ -453,11 +454,12 @@ static void updown(private_child_sa_t *this, bool up)
*/
static void set_state(private_child_sa_t *this, child_sa_state_t state)
{
- this->state = state;
if (state == CHILD_INSTALLED)
{
updown(this, TRUE);
}
+ charon->bus->child_state_change(charon->bus, &this->public, state);
+ this->state = state;
}
/**
@@ -751,7 +753,7 @@ static status_t add_policies(private_child_sa_t *this,
/* switch to routed state if no SAD entry set up */
if (this->state == CHILD_CREATED)
{
- this->state = CHILD_ROUTED;
+ set_state(this, CHILD_ROUTED);
}
/* needed to update hosts */
this->mode = mode;
@@ -961,6 +963,8 @@ static void destroy(private_child_sa_t *this)
updown(this, FALSE);
}
+ set_state(this, CHILD_DESTROYING);
+
/* delete SAs in the kernel, if they are set up */
if (this->me.spi)
{