aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/plugins/updown/updown_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/plugins/updown/updown_plugin.c')
-rw-r--r--src/charon/plugins/updown/updown_plugin.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/charon/plugins/updown/updown_plugin.c b/src/charon/plugins/updown/updown_plugin.c
index e8fea0273..0e054cab6 100644
--- a/src/charon/plugins/updown/updown_plugin.c
+++ b/src/charon/plugins/updown/updown_plugin.c
@@ -199,16 +199,19 @@ static bool child_state_change(listener_t *this, ike_sa_t *ike_sa,
{
child_sa_state_t old;
- old = child_sa->get_state(child_sa);
-
- if ((old == CHILD_INSTALLED && state != CHILD_REKEYING ) ||
- (old == CHILD_DELETING && state == CHILD_DESTROYING))
- {
- updown(ike_sa, child_sa, FALSE);
- }
- else if (state == CHILD_INSTALLED)
+ if (ike_sa)
{
- updown(ike_sa, child_sa, TRUE);
+ old = child_sa->get_state(child_sa);
+
+ if ((old == CHILD_INSTALLED && state != CHILD_REKEYING ) ||
+ (old == CHILD_DELETING && state == CHILD_DESTROYING))
+ {
+ updown(ike_sa, child_sa, FALSE);
+ }
+ else if (state == CHILD_INSTALLED)
+ {
+ updown(ike_sa, child_sa, TRUE);
+ }
}
return TRUE;
}