fixed inproper delete of CHILD_SA
authorMartin Willi <martin@strongswan.org>
Wed, 21 Mar 2007 07:01:14 +0000 (07:01 -0000)
committerMartin Willi <martin@strongswan.org>
Wed, 21 Mar 2007 07:01:14 +0000 (07:01 -0000)
src/charon/sa/tasks/child_delete.c

index 5258aa0..4fb7214 100644 (file)
@@ -135,10 +135,13 @@ static void process_payloads(private_child_delete_t *this, message_t *message)
                                                /* we reply as usual, rekeying will fail */
                                                break;
                                        case CHILD_DELETING:
-                                               /* we don't send back a delete */
-                                               this->ike_sa->destroy_child_sa(this->ike_sa,
-                                                                                                          protocol, *spi);
-                                               continue;
+                                               /* 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;
+                                               }
                                        default:
                                                break;
                                }