From 1bc0b4f7959ca4ddb2af0715599e3a177a6e2f01 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 25 Aug 2009 18:12:55 +0200 Subject: [PATCH] remove incomplete SAs with PROTO_ESP --- src/charon/sa/child_sa.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/charon/sa/child_sa.c b/src/charon/sa/child_sa.c index 14d174ab5..28c513683 100644 --- a/src/charon/sa/child_sa.c +++ b/src/charon/sa/child_sa.c @@ -819,6 +819,12 @@ static void destroy(private_child_sa_t *this) /* delete SAs in the kernel, if they are set up */ if (this->my_spi) { + /* if CHILD was not established, use PROTO_ESP used during alloc_spi(). + * TODO: For AH support, we have to store protocol specific SPI.s */ + if (this->protocol == PROTO_NONE) + { + this->protocol = PROTO_ESP; + } charon->kernel_interface->del_sa(charon->kernel_interface, this->other_addr, this->my_addr, this->my_spi, this->protocol, this->my_cpi);