unity: Check IKE_SA in only after enumerating virtual IPs
authorTobias Brunner <tobias@strongswan.org>
Fri, 5 Apr 2013 11:45:04 +0000 (13:45 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 5 Apr 2013 14:03:10 +0000 (16:03 +0200)
src/libcharon/plugins/unity/unity_handler.c

index 9d145b9..3dec7a3 100644 (file)
@@ -190,8 +190,6 @@ static job_requeue_t add_exclude_async(entry_t *entry)
                child_cfg->add_traffic_selector(child_cfg, TRUE,
                                traffic_selector_create_from_subnet(host->clone(host),
                                                                                                        32, 0, 0, 65535));
-               charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
-
                enumerator = ike_sa->create_virtual_ip_enumerator(ike_sa, TRUE);
                while (enumerator->enumerate(enumerator, &host))
                {
@@ -200,6 +198,7 @@ static job_requeue_t add_exclude_async(entry_t *entry)
                                                                                                        32, 0, 0, 65535));
                }
                enumerator->destroy(enumerator);
+               charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
 
                charon->shunts->install(charon->shunts, child_cfg);
                child_cfg->destroy(child_cfg);