From: Tobias Brunner Date: Thu, 12 May 2016 10:22:35 +0000 (+0200) Subject: child-delete: Remove unnecessary call to destroy_child_sa() X-Git-Tag: 5.5.0dr1~4^2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94012e3f420bbd499e50ffd79613a1a611ea05b6;p=thirdparty%2Fstrongswan.git child-delete: Remove unnecessary call to destroy_child_sa() Generally, we will not find the CHILD_SA by searching for it with the outbound SPI (the initiator of the DELETE sent its inbound SPI) - and if we found a CHILD_SA it would most likely be the wrong one (one in which we used the same inbound SPI as the peer used for the one it deletes). And we don't actually want to destroy the CHILD_SA at this point as we know we already initiated a DELETE ourselves, which means that task still has a reference to it and will destroy the CHILD_SA when it receives the response from the other peer. --- diff --git a/src/libcharon/sa/ikev2/tasks/child_delete.c b/src/libcharon/sa/ikev2/tasks/child_delete.c index 053a5c51df..52661f9547 100644 --- a/src/libcharon/sa/ikev2/tasks/child_delete.c +++ b/src/libcharon/sa/ikev2/tasks/child_delete.c @@ -165,8 +165,6 @@ static void process_payloads(private_child_delete_t *this, message_t *message) /* we don't send back a delete if we initiated ourself */ if (!this->initiator) { - this->ike_sa->destroy_child_sa(this->ike_sa, - protocol, spi); continue; } /* fall through */