Explicitly configure MOBIKE tasks to update the list of additional addresses.
authorTobias Brunner <tobias@strongswan.org>
Tue, 5 Oct 2010 14:49:20 +0000 (16:49 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 12 Oct 2010 09:11:05 +0000 (11:11 +0200)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/tasks/ike_mobike.c
src/libcharon/sa/tasks/ike_mobike.h

index 998095f..0df517a 100644 (file)
@@ -1740,6 +1740,7 @@ METHOD(ike_sa_t, roam, status_t,
                {
                        DBG1(DBG_IKE, "sending address list update using MOBIKE");
                        mobike = ike_mobike_create(&this->public, TRUE);
+                       mobike->addresses(mobike);
                        this->task_manager->queue_task(this->task_manager, (task_t*)mobike);
                        return this->task_manager->initiate(this->task_manager);
                }
index 3b1fbb0..e63a421 100644 (file)
@@ -540,6 +540,14 @@ METHOD(task_t, process_i, status_t,
        return NEED_MORE;
 }
 
+METHOD(ike_mobike_t, addresses, void,
+          private_ike_mobike_t *this)
+{
+       this->address = TRUE;
+       this->ike_sa->set_pending_updates(this->ike_sa,
+                                               this->ike_sa->get_pending_updates(this->ike_sa) + 1);
+}
+
 METHOD(ike_mobike_t, roam, void,
           private_ike_mobike_t *this, bool address)
 {
@@ -556,7 +564,6 @@ METHOD(ike_mobike_t, dpd, void,
        {
                this->natd = ike_natd_create(this->ike_sa, this->initiator);
        }
-       this->address = FALSE;
        this->ike_sa->set_pending_updates(this->ike_sa,
                                                this->ike_sa->get_pending_updates(this->ike_sa) + 1);
 }
@@ -609,6 +616,7 @@ ike_mobike_t *ike_mobike_create(ike_sa_t *ike_sa, bool initiator)
                                .migrate = _migrate,
                                .destroy = _destroy,
                        },
+                       .addresses = _addresses,
                        .roam = _roam,
                        .dpd = _dpd,
                        .transmit = _transmit,
@@ -616,7 +624,6 @@ ike_mobike_t *ike_mobike_create(ike_sa_t *ike_sa, bool initiator)
                },
                .ike_sa = ike_sa,
                .initiator = initiator,
-               .address = TRUE,
        );
 
        if (initiator)
index 05b2224..1661193 100644 (file)
@@ -46,6 +46,11 @@ struct ike_mobike_t {
        task_t task;
 
        /**
+        * Use the task to update the list of additional addresses.
+        */
+       void (*addresses)(ike_mobike_t *this);
+
+       /**
         * Use the task to roam to other addresses.
         *
         * @param address               TRUE to include address list update