From: Martin Willi Date: Thu, 20 Jun 2013 10:05:13 +0000 (+0200) Subject: ikev2: use protocol of selected proposal to delete a failed CHILD_SA X-Git-Tag: 5.1.0dr1~102 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=888dbac50e455cee943f0aa16013b0c157cda19f;p=thirdparty%2Fstrongswan.git ikev2: use protocol of selected proposal to delete a failed CHILD_SA Depending on the failure, the protocol might not yet be set on the CHILD_SA. --- diff --git a/src/libcharon/sa/ikev2/tasks/child_create.c b/src/libcharon/sa/ikev2/tasks/child_create.c index 3e5dcc82eb..dd3813e85f 100644 --- a/src/libcharon/sa/ikev2/tasks/child_create.c +++ b/src/libcharon/sa/ikev2/tasks/child_create.c @@ -1284,13 +1284,13 @@ 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) + if (this->child_sa && this->proposal) { protocol_id_t proto; delete_payload_t *del; u_int32_t spi; - proto = this->child_sa->get_protocol(this->child_sa); + proto = this->proposal->get_protocol(this->proposal); spi = this->child_sa->get_spi(this->child_sa, TRUE); del = delete_payload_create(DELETE, proto); del->add_spi(del, spi);