Pass all configured pool names to attribute provider enumerator
This commit is contained in:
@@ -129,7 +129,7 @@ METHOD(attribute_provider_t, release_address, bool,
|
||||
}
|
||||
|
||||
METHOD(attribute_provider_t, create_attribute_enumerator, enumerator_t*,
|
||||
private_dhcp_provider_t *this, char *pool, identification_t *id,
|
||||
private_dhcp_provider_t *this, linked_list_t *pools, identification_t *id,
|
||||
linked_list_t *vips)
|
||||
{
|
||||
dhcp_transaction_t *transaction = NULL;
|
||||
|
||||
@@ -148,8 +148,8 @@ static bool attr_filter(void *lock, host_t **in,
|
||||
}
|
||||
|
||||
METHOD(attribute_provider_t, create_attribute_enumerator, enumerator_t*,
|
||||
private_stroke_attribute_t *this, char *pool, identification_t *id,
|
||||
linked_list_t *vips)
|
||||
private_stroke_attribute_t *this, linked_list_t *pools,
|
||||
identification_t *id, linked_list_t *vips)
|
||||
{
|
||||
ike_sa_t *ike_sa;
|
||||
peer_cfg_t *peer_cfg;
|
||||
|
||||
@@ -326,7 +326,7 @@ METHOD(task_t, build_r, status_t,
|
||||
cp_payload_t *cp = NULL;
|
||||
peer_cfg_t *config;
|
||||
identification_t *id;
|
||||
linked_list_t *vips;
|
||||
linked_list_t *vips, *pools;
|
||||
char *pool;
|
||||
|
||||
id = this->ike_sa->get_other_eap_id(this->ike_sa);
|
||||
@@ -365,8 +365,14 @@ METHOD(task_t, build_r, status_t,
|
||||
{
|
||||
vips->insert_last(vips, vip);
|
||||
}
|
||||
pools = linked_list_create();
|
||||
/* TODO: use list of all pools */
|
||||
if (pool)
|
||||
{
|
||||
pools->insert_last(pools, pool);
|
||||
}
|
||||
enumerator = hydra->attributes->create_responder_enumerator(
|
||||
hydra->attributes, pool, id, vips);
|
||||
hydra->attributes, pools, id, vips);
|
||||
while (enumerator->enumerate(enumerator, &type, &value))
|
||||
{
|
||||
if (!cp)
|
||||
@@ -381,6 +387,7 @@ METHOD(task_t, build_r, status_t,
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
vips->destroy(vips);
|
||||
pools->destroy(pools);
|
||||
|
||||
if (cp)
|
||||
{
|
||||
|
||||
@@ -338,7 +338,7 @@ METHOD(task_t, build_r, status_t,
|
||||
cp_payload_t *cp = NULL;
|
||||
peer_cfg_t *config;
|
||||
identification_t *id;
|
||||
linked_list_t *vips;
|
||||
linked_list_t *vips, *pools;
|
||||
char *pool;
|
||||
|
||||
id = this->ike_sa->get_other_eap_id(this->ike_sa);
|
||||
@@ -381,8 +381,14 @@ METHOD(task_t, build_r, status_t,
|
||||
{
|
||||
vips->insert_last(vips, vip);
|
||||
}
|
||||
pools = linked_list_create();
|
||||
/* TODO: use list of all pools */
|
||||
if (pool)
|
||||
{
|
||||
pools->insert_last(pools, pool);
|
||||
}
|
||||
enumerator = hydra->attributes->create_responder_enumerator(
|
||||
hydra->attributes, pool, id, vips);
|
||||
hydra->attributes, pools, id, vips);
|
||||
while (enumerator->enumerate(enumerator, &type, &value))
|
||||
{
|
||||
if (!cp)
|
||||
@@ -397,6 +403,7 @@ METHOD(task_t, build_r, status_t,
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
vips->destroy(vips);
|
||||
pools->destroy(pools);
|
||||
|
||||
if (cp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user