Support multiple address pools configured on a peer_cfg
This commit is contained in:
@@ -413,23 +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);
|
||||
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))
|
||||
{
|
||||
enumerator = ike_sa->create_virtual_ip_enumerator(ike_sa,
|
||||
FALSE);
|
||||
while (enumerator->enumerate(enumerator, &vip))
|
||||
vips = ike_sa->create_virtual_ip_enumerator(ike_sa, FALSE);
|
||||
while (vips->enumerate(vips, &vip))
|
||||
{
|
||||
this->attr->reserve(this->attr, pool, vip);
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
vips->destroy(vips);
|
||||
}
|
||||
pools->destroy(pools);
|
||||
}
|
||||
}
|
||||
if (ike_sa->get_version(ike_sa) == IKEV1)
|
||||
|
||||
@@ -209,7 +209,7 @@ static void setup_tunnel(private_ha_tunnel_t *this,
|
||||
ike_cfg->add_proposal(ike_cfg, proposal_create_default(PROTO_IKE));
|
||||
peer_cfg = peer_cfg_create("ha", IKEV2, ike_cfg, CERT_NEVER_SEND,
|
||||
UNIQUE_KEEP, 0, 86400, 0, 7200, 3600, FALSE, FALSE, 30,
|
||||
0, NULL, FALSE, NULL, NULL);
|
||||
0, FALSE, NULL, NULL);
|
||||
|
||||
auth_cfg = auth_cfg_create();
|
||||
auth_cfg->add(auth_cfg, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PSK);
|
||||
|
||||
Reference in New Issue
Block a user