diff options
author | Martin Willi <martin@revosec.ch> | 2013-02-20 16:15:39 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-02-20 16:15:39 +0100 |
commit | 122b4b6e6d948b1b5ffac7d4e99030ae4d53a189 (patch) | |
tree | 914bcf83445c69172a6341c3033d8c348396f6d6 /src/libcharon/plugins/unity/unity_handler.c | |
parent | 7a93844f210023fabdd86601d3ffbb795cd8f5b4 (diff) | |
download | strongswan-122b4b6e6d948b1b5ffac7d4e99030ae4d53a189.tar.bz2 strongswan-122b4b6e6d948b1b5ffac7d4e99030ae4d53a189.tar.xz |
Include local address for Unity Split-Exclude shunt policies
If we use a virtual IP, having a shunt policy for just that wouldn't work, as
we want a shunt bypass using the local address.
Diffstat (limited to 'src/libcharon/plugins/unity/unity_handler.c')
-rw-r--r-- | src/libcharon/plugins/unity/unity_handler.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/libcharon/plugins/unity/unity_handler.c b/src/libcharon/plugins/unity/unity_handler.c index 31d13add2..30573c7ff 100644 --- a/src/libcharon/plugins/unity/unity_handler.c +++ b/src/libcharon/plugins/unity/unity_handler.c @@ -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,23 +186,19 @@ 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)); + 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)); } 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)); - } - charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); - charon->shunts->install(charon->shunts, child_cfg); child_cfg->destroy(child_cfg); |