Pass the full list of pools to acquire_address, enumerate in providers
If the provider has access to the full pool list, it can enumerate them twice, for example to search for existing leases first, and only search for new leases in a second step. Fixes lease enumeration in attr-sql using multiple pools.
This commit is contained in:
@@ -27,6 +27,7 @@ static void* testing(void *thread)
|
||||
int i;
|
||||
host_t *addr[ALLOCS];
|
||||
identification_t *id[ALLOCS];
|
||||
linked_list_t *pools;
|
||||
|
||||
/* prepare identities */
|
||||
for (i = 0; i < ALLOCS; i++)
|
||||
@@ -37,17 +38,23 @@ static void* testing(void *thread)
|
||||
id[i] = identification_create_from_string(buf);
|
||||
}
|
||||
|
||||
pools = linked_list_create();
|
||||
pools->insert_last(pools, "test");
|
||||
|
||||
/* allocate addresses */
|
||||
for (i = 0; i < ALLOCS; i++)
|
||||
{
|
||||
addr[i] = hydra->attributes->acquire_address(hydra->attributes,
|
||||
"test", id[i], NULL);
|
||||
pools, id[i], NULL);
|
||||
if (!addr[i])
|
||||
{
|
||||
pools->destroy(pools);
|
||||
return (void*)FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
pools->destroy(pools);
|
||||
|
||||
/* release addresses */
|
||||
for (i = 0; i < ALLOCS; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user