Use version specific DELETE payload identifier in ike_delete task
authorMartin Willi <martin@revosec.ch>
Tue, 13 Dec 2011 09:36:42 +0000 (10:36 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:19 +0000 (17:31 +0100)
src/libcharon/sa/tasks/ike_delete.c

index dccd858..0318b9c 100755 (executable)
@@ -65,7 +65,14 @@ METHOD(task_t, build_i, status_t,
                 this->ike_sa->get_other_host(this->ike_sa),
                 this->ike_sa->get_other_id(this->ike_sa));
 
-       delete_payload = delete_payload_create(DELETE, PROTO_IKE);
+       if (this->ike_sa->get_version(this->ike_sa) == IKEV1)
+       {
+               delete_payload = delete_payload_create(DELETE_V1, PROTO_IKE);
+       }
+       else
+       {
+               delete_payload = delete_payload_create(DELETE, PROTO_IKE);
+       }
        message->add_payload(message, (payload_t*)delete_payload);
 
        if (this->ike_sa->get_state(this->ike_sa) == IKE_REKEYING)