]> git.ipfire.org Git - people/ms/strongswan.git/blobdiff - src/libcharon/plugins/unity/unity_handler.c
Merge branch 'vip-shunts'
[people/ms/strongswan.git] / src / libcharon / plugins / unity / unity_handler.c
index 39dd5f0963870ebbe516b6d10c9192d8ec124777..9d145b93f947c28971d2c4d68e55c2a2a8fd128a 100644 (file)
@@ -174,7 +174,6 @@ static job_requeue_t add_exclude_async(entry_t *entry)
        ike_sa_t *ike_sa;
        char name[128];
        host_t *host;
-       bool has_vip = FALSE;
 
        ike_sa = charon->ike_sa_manager->checkout_by_id(charon->ike_sa_manager,
                                                                                                        entry->sa, FALSE);
@@ -187,25 +186,21 @@ static job_requeue_t add_exclude_async(entry_t *entry)
                                                                         FALSE, 0, 0, NULL, NULL, FALSE);
                child_cfg->add_traffic_selector(child_cfg, FALSE,
                                                                                entry->ts->clone(entry->ts));
+               host = ike_sa->get_my_host(ike_sa);
+               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))
                {
-                       has_vip = TRUE;
                        child_cfg->add_traffic_selector(child_cfg, TRUE,
                                traffic_selector_create_from_subnet(host->clone(host),
                                                                                                        32, 0, 0, 65535));
                }
                enumerator->destroy(enumerator);
 
-               if (!has_vip)
-               {
-                       host = ike_sa->get_my_host(ike_sa);
-                       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);
-
                charon->shunts->install(charon->shunts, child_cfg);
                child_cfg->destroy(child_cfg);