aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa/ikev1/tasks/mode_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/sa/ikev1/tasks/mode_config.c')
-rw-r--r--src/libcharon/sa/ikev1/tasks/mode_config.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libcharon/sa/ikev1/tasks/mode_config.c b/src/libcharon/sa/ikev1/tasks/mode_config.c
index 6ba3e6768..bad599b83 100644
--- a/src/libcharon/sa/ikev1/tasks/mode_config.c
+++ b/src/libcharon/sa/ikev1/tasks/mode_config.c
@@ -310,17 +310,24 @@ METHOD(task_t, build_r, status_t,
cp_payload_t *cp = NULL;
peer_cfg_t *config;
identification_t *id;
+ char *pool;
id = this->ike_sa->get_other_eap_id(this->ike_sa);
config = this->ike_sa->get_peer_cfg(this->ike_sa);
+ enumerator = config->create_pool_enumerator(config);
+ if (!enumerator->enumerate(enumerator, &pool))
+ { /* TODO: currently we query the first pool, only */
+ pool = NULL;
+ }
+ enumerator->destroy(enumerator);
if (this->virtual_ip)
{
DBG1(DBG_IKE, "peer requested virtual IP %H", this->virtual_ip);
- if (config->get_pool(config))
+ if (pool)
{
vip = hydra->attributes->acquire_address(hydra->attributes,
- config->get_pool(config), id, this->virtual_ip);
+ pool, id, this->virtual_ip);
}
cp = cp_payload_create_type(CONFIGURATION_V1, CFG_REPLY);
if (vip)
@@ -336,7 +343,7 @@ METHOD(task_t, build_r, status_t,
}
/* query registered providers for additional attributes to include */
enumerator = hydra->attributes->create_responder_enumerator(
- hydra->attributes, config->get_pool(config), id, vip);
+ hydra->attributes, pool, id, vip);
while (enumerator->enumerate(enumerator, &type, &value))
{
if (!cp)