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.
This commit is contained in:
Martin Willi 2013-06-20 12:05:13 +02:00
parent 47ec2e407b
commit 888dbac50e
1 changed files with 2 additions and 2 deletions

View File

@ -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);