ikev2: Don't treat initial messages as MOBIKE exchanges
authorTobias Brunner <tobias@strongswan.org>
Tue, 16 Sep 2014 12:59:05 +0000 (14:59 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 16 Sep 2014 13:05:12 +0000 (15:05 +0200)
The MOBIKE task is active during the initial exchanges but we don't want
to treat them as actual MOBIKE exchanges (i.e. there is no path probing).

src/libcharon/sa/ikev2/task_manager_v2.c

index 58f6bc6..0bc5a35 100644 (file)
@@ -235,16 +235,19 @@ METHOD(task_manager_t, retransmit, status_t,
                ike_mobike_t *mobike = NULL;
 
                /* check if we are retransmitting a MOBIKE routability check */
-               enumerator = array_create_enumerator(this->active_tasks);
-               while (enumerator->enumerate(enumerator, (void*)&task))
+               if (this->initiating.type == INFORMATIONAL)
                {
-                       if (task->get_type(task) == TASK_IKE_MOBIKE)
+                       enumerator = array_create_enumerator(this->active_tasks);
+                       while (enumerator->enumerate(enumerator, (void*)&task))
                        {
-                               mobike = (ike_mobike_t*)task;
-                               break;
+                               if (task->get_type(task) == TASK_IKE_MOBIKE)
+                               {
+                                       mobike = (ike_mobike_t*)task;
+                                       break;
+                               }
                        }
+                       enumerator->destroy(enumerator);
                }
-               enumerator->destroy(enumerator);
 
                if (!mobike || !mobike->is_probing(mobike))
                {