aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/ha/ha_dispatcher.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-08-31 12:55:56 +0200
committerMartin Willi <martin@revosec.ch>2012-08-31 12:55:56 +0200
commit1323dc1138246a6e2819bcc20b167b75d52e6d7c (patch)
tree5081fcc1d015a8cd0ec6dfe39a8df14f12d86ac5 /src/libcharon/plugins/ha/ha_dispatcher.c
parent868409139b00f24607baab2d81b873cb1a5a9e5b (diff)
parent69e056a2c13ac7da9ed4e48f846d642aa01a362b (diff)
downloadstrongswan-1323dc1138246a6e2819bcc20b167b75d52e6d7c.tar.bz2
strongswan-1323dc1138246a6e2819bcc20b167b75d52e6d7c.tar.xz
Merge branch 'multi-vip'
Brings support for multiple virtual IPs and multiple pools in left/rigthsourceip definitions. Also introduces the new left/rightdns options to configure requested DNS server address family and respond with multiple connection specific servers.
Diffstat (limited to 'src/libcharon/plugins/ha/ha_dispatcher.c')
-rw-r--r--src/libcharon/plugins/ha/ha_dispatcher.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libcharon/plugins/ha/ha_dispatcher.c b/src/libcharon/plugins/ha/ha_dispatcher.c
index 8b6ec9180..f07b4ea21 100644
--- a/src/libcharon/plugins/ha/ha_dispatcher.c
+++ b/src/libcharon/plugins/ha/ha_dispatcher.c
@@ -344,10 +344,10 @@ static void process_ike_update(private_ha_dispatcher_t *this,
ike_sa->set_other_host(ike_sa, value.host->clone(value.host));
break;
case HA_LOCAL_VIP:
- ike_sa->set_virtual_ip(ike_sa, TRUE, value.host);
+ ike_sa->add_virtual_ip(ike_sa, TRUE, value.host);
break;
case HA_REMOTE_VIP:
- ike_sa->set_virtual_ip(ike_sa, FALSE, value.host);
+ ike_sa->add_virtual_ip(ike_sa, FALSE, value.host);
received_vip = TRUE;
break;
case HA_PEER_ADDR:
@@ -413,18 +413,24 @@ static void process_ike_update(private_ha_dispatcher_t *this,
}
if (received_vip)
{
+ enumerator_t *pools, *vips;
host_t *vip;
char *pool;
peer_cfg = ike_sa->get_peer_cfg(ike_sa);
- vip = ike_sa->get_virtual_ip(ike_sa, FALSE);
- if (peer_cfg && vip)
+ if (peer_cfg)
{
- pool = peer_cfg->get_pool(peer_cfg);
- if (pool)
+ pools = peer_cfg->create_pool_enumerator(peer_cfg);
+ while (pools->enumerate(pools, &pool))
{
- this->attr->reserve(this->attr, pool, vip);
+ vips = ike_sa->create_virtual_ip_enumerator(ike_sa, FALSE);
+ while (vips->enumerate(vips, &vip))
+ {
+ this->attr->reserve(this->attr, pool, vip);
+ }
+ vips->destroy(vips);
}
+ pools->destroy(pools);
}
}
if (ike_sa->get_version(ike_sa) == IKEV1)