]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ikev2: Use REKEY_SA as sole trigger for CHILD_SA rekeying
authorTobias Brunner <tobias@strongswan.org>
Tue, 21 Mar 2023 14:02:28 +0000 (15:02 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 22 Mar 2023 10:37:52 +0000 (11:37 +0100)
There won't be any TS payloads when using optimized rekeying.

src/libcharon/sa/ikev2/task_manager_v2.c

index be41f84e091e3a1adf15bdd5d0ea4e2f64ca022c..340cfc0b1be8f8d28b944089b84b6f55e15316eb 100644 (file)
@@ -1230,7 +1230,7 @@ static status_t process_request(private_task_manager_t *this,
                                        switch (payload->get_type(payload))
                                        {
                                                case PLV2_NOTIFY:
-                                               {       /* if we find a rekey notify, its CHILD_SA rekeying */
+                                               {
                                                        notify = (notify_payload_t*)payload;
                                                        if (notify->get_notify_type(notify) == REKEY_SA &&
                                                                (notify->get_protocol_id(notify) == PROTO_AH ||
@@ -1242,7 +1242,7 @@ static status_t process_request(private_task_manager_t *this,
                                                }
                                                case PLV2_TS_INITIATOR:
                                                case PLV2_TS_RESPONDER:
-                                               {       /* if we don't find a TS, its IKE rekeying */
+                                               {
                                                        ts_found = TRUE;
                                                        break;
                                                }
@@ -1252,18 +1252,16 @@ static status_t process_request(private_task_manager_t *this,
                                }
                                enumerator->destroy(enumerator);
 
-                               if (ts_found)
+                               if (notify_found)
                                {
-                                       if (notify_found)
-                                       {
-                                               task = (task_t*)child_rekey_create(this->ike_sa,
-                                                                                                                  PROTO_NONE, 0);
-                                       }
-                                       else
-                                       {
-                                               task = (task_t*)child_create_create(this->ike_sa, NULL,
-                                                                                                                       FALSE, NULL, NULL);
-                                       }
+                                       task = (task_t*)child_rekey_create(this->ike_sa,
+                                                                                                          PROTO_NONE, 0);
+                               }
+                               else if (ts_found)
+                               {
+
+                                       task = (task_t*)child_create_create(this->ike_sa, NULL,
+                                                                                                               FALSE, NULL, NULL);
                                }
                                else
                                {