aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-08-19 16:16:01 +0200
committerTobias Brunner <tobias@strongswan.org>2015-08-21 16:14:07 +0200
commit105365eabe7408eeac6227766e34c5ebc25ae618 (patch)
tree538976111ea3c8d5a064e0ff65474903fbc2a572 /src
parentf91bd4b92cfa0a1bf0a597dc95d6b714212a8282 (diff)
downloadstrongswan-105365eabe7408eeac6227766e34c5ebc25ae618.tar.bz2
strongswan-105365eabe7408eeac6227766e34c5ebc25ae618.tar.xz
child-rekey: Don't add a REKEY_SA notify if the child-create task is deleting the SA
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/sa/ikev2/tasks/child_rekey.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libcharon/sa/ikev2/tasks/child_rekey.c b/src/libcharon/sa/ikev2/tasks/child_rekey.c
index 4dc9aaf33..c7a8a1342 100644
--- a/src/libcharon/sa/ikev2/tasks/child_rekey.c
+++ b/src/libcharon/sa/ikev2/tasks/child_rekey.c
@@ -170,13 +170,8 @@ METHOD(task_t, build_i, status_t,
}
config = this->child_sa->get_config(this->child_sa);
- /* we just need the rekey notify ... */
- notify = notify_payload_create_from_protocol_and_type(PLV2_NOTIFY,
- this->protocol, REKEY_SA);
- notify->set_spi(notify, this->spi);
- message->add_payload(message, (payload_t*)notify);
- /* ... our CHILD_CREATE task does the hard work for us. */
+ /* our CHILD_CREATE task does the hard work for us */
if (!this->child_create)
{
this->child_create = child_create_create(this->ike_sa,
@@ -194,6 +189,14 @@ METHOD(task_t, build_i, status_t,
schedule_delayed_rekey(this);
return FAILED;
}
+ if (message->get_exchange_type(message) == CREATE_CHILD_SA)
+ {
+ /* don't add the notify if the CHILD_CREATE task changed the exchange */
+ notify = notify_payload_create_from_protocol_and_type(PLV2_NOTIFY,
+ this->protocol, REKEY_SA);
+ notify->set_spi(notify, this->spi);
+ message->add_payload(message, (payload_t*)notify);
+ }
this->child_sa->set_state(this->child_sa, CHILD_REKEYING);
return NEED_MORE;