Queue a mode config task as responder if we need a virtual IP
authorMartin Willi <martin@revosec.ch>
Tue, 26 Jun 2012 08:35:24 +0000 (10:35 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 27 Jun 2012 09:42:56 +0000 (11:42 +0200)
src/libcharon/sa/ikev1/tasks/aggressive_mode.c
src/libcharon/sa/ikev1/tasks/main_mode.c

index d6ed9aa..ec31548 100644 (file)
@@ -478,7 +478,7 @@ METHOD(task_t, process_r, status_t,
                                case AUTH_XAUTH_RESP_RSA:
                                case AUTH_HYBRID_RESP_RSA:
                                        /* wait for XAUTH request */
-                                       return SUCCESS;
+                                       break;
                                default:
                                        if (charon->ike_sa_manager->check_uniqueness(
                                                                charon->ike_sa_manager, this->ike_sa, FALSE))
@@ -494,8 +494,14 @@ METHOD(task_t, process_r, status_t,
                                        lib->processor->queue_job(lib->processor, (job_t*)
                                                                        adopt_children_job_create(
                                                                                this->ike_sa->get_id(this->ike_sa)));
-                                       return SUCCESS;
+                                       break;
+                       }
+                       if (this->peer_cfg->get_virtual_ip(this->peer_cfg))
+                       {
+                               this->ike_sa->queue_task(this->ike_sa,
+                                                       (task_t*)mode_config_create(this->ike_sa, TRUE));
                        }
+                       return SUCCESS;
                }
                default:
                        return FAILED;
index a65b3a6..fc487e1 100644 (file)
@@ -506,7 +506,7 @@ METHOD(task_t, build_r, status_t,
                                case AUTH_XAUTH_RESP_RSA:
                                case AUTH_HYBRID_RESP_RSA:
                                        /* wait for XAUTH request */
-                                       return SUCCESS;
+                                       break;
                                default:
                                        if (charon->ike_sa_manager->check_uniqueness(
                                                                charon->ike_sa_manager, this->ike_sa, FALSE))
@@ -522,8 +522,14 @@ METHOD(task_t, build_r, status_t,
                                        lib->processor->queue_job(lib->processor, (job_t*)
                                                                        adopt_children_job_create(
                                                                                this->ike_sa->get_id(this->ike_sa)));
-                                       return SUCCESS;
+                                       break;
+                       }
+                       if (this->peer_cfg->get_virtual_ip(this->peer_cfg))
+                       {
+                               this->ike_sa->queue_task(this->ike_sa,
+                                                       (task_t*)mode_config_create(this->ike_sa, TRUE));
                        }
+                       return SUCCESS;
                }
                default:
                        return FAILED;