aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa/ikev2/tasks/child_create.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-08-19 15:08:02 +0200
committerTobias Brunner <tobias@strongswan.org>2015-08-21 16:14:07 +0200
commitffe0889acd4be545e71b6b4133e9c683aea016da (patch)
tree036dd6b811ae0fd92aaf6585f78661651421d25f /src/libcharon/sa/ikev2/tasks/child_create.c
parent70c5f1d40d5af928650ffee78e1a9e68950e8b79 (diff)
downloadstrongswan-ffe0889acd4be545e71b6b4133e9c683aea016da.tar.bz2
strongswan-ffe0889acd4be545e71b6b4133e9c683aea016da.tar.xz
child-create: Don't attempt to delete the SA if we don't have all the information
Since we only support single protocols we could probably guess it and always send a DELETE.
Diffstat (limited to 'src/libcharon/sa/ikev2/tasks/child_create.c')
-rw-r--r--src/libcharon/sa/ikev2/tasks/child_create.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libcharon/sa/ikev2/tasks/child_create.c b/src/libcharon/sa/ikev2/tasks/child_create.c
index ee5086fe1..d77d4f526 100644
--- a/src/libcharon/sa/ikev2/tasks/child_create.c
+++ b/src/libcharon/sa/ikev2/tasks/child_create.c
@@ -1352,20 +1352,18 @@ METHOD(task_t, build_i_delete, status_t,
private_child_create_t *this, message_t *message)
{
message->set_exchange_type(message, INFORMATIONAL);
- if (this->child_sa && this->proposal)
+ if (this->proposal)
{
protocol_id_t proto;
delete_payload_t *del;
- u_int32_t spi;
proto = this->proposal->get_protocol(this->proposal);
- spi = this->child_sa->get_spi(this->child_sa, TRUE);
del = delete_payload_create(PLV2_DELETE, proto);
- del->add_spi(del, spi);
+ del->add_spi(del, this->my_spi);
message->add_payload(message, (payload_t*)del);
DBG1(DBG_IKE, "sending DELETE for %N CHILD_SA with SPI %.8x",
- protocol_id_names, proto, ntohl(spi));
+ protocol_id_names, proto, ntohl(this->my_spi));
}
return NEED_MORE;
}
@@ -1375,9 +1373,13 @@ METHOD(task_t, build_i_delete, status_t,
*/
static status_t delete_failed_sa(private_child_create_t *this)
{
- this->public.task.build = _build_i_delete;
- this->public.task.process = (void*)return_success;
- return NEED_MORE;
+ if (this->proposal)
+ {
+ this->public.task.build = _build_i_delete;
+ this->public.task.process = (void*)return_success;
+ return NEED_MORE;
+ }
+ return SUCCESS;
}
METHOD(task_t, process_i, status_t,