diff options
author | Martin Willi <martin@revosec.ch> | 2012-09-11 11:19:56 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-09-11 16:18:28 +0200 |
commit | 28a3d5bfbde466f71a3f8b692d58b775ff7290ce (patch) | |
tree | 8dd021fd6e158054914b3378970a8ef6fe1932d2 /src/libcharon/plugins/stroke/stroke_attribute.c | |
parent | 594c58e1118e496eadd284647755b16b74665337 (diff) | |
download | strongswan-28a3d5bfbde466f71a3f8b692d58b775ff7290ce.tar.bz2 strongswan-28a3d5bfbde466f71a3f8b692d58b775ff7290ce.tar.xz |
Pass full pool list to release_address
Diffstat (limited to 'src/libcharon/plugins/stroke/stroke_attribute.c')
-rw-r--r-- | src/libcharon/plugins/stroke/stroke_attribute.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_attribute.c b/src/libcharon/plugins/stroke/stroke_attribute.c index 99392bfd7..e0c8360a1 100644 --- a/src/libcharon/plugins/stroke/stroke_attribute.c +++ b/src/libcharon/plugins/stroke/stroke_attribute.c @@ -119,19 +119,31 @@ METHOD(attribute_provider_t, acquire_address, host_t*, } METHOD(attribute_provider_t, release_address, bool, - private_stroke_attribute_t *this, char *name, host_t *address, + private_stroke_attribute_t *this, linked_list_t *pools, host_t *address, identification_t *id) { + enumerator_t *enumerator; mem_pool_t *pool; bool found = FALSE; + char *name; + enumerator = pools->create_enumerator(pools); this->lock->read_lock(this->lock); - pool = find_pool(this, name); - if (pool) + while (enumerator->enumerate(enumerator, &name)) { - found = pool->release_address(pool, address, id); + pool = find_pool(this, name); + if (pool) + { + found = pool->release_address(pool, address, id); + if (found) + { + break; + } + } } this->lock->unlock(this->lock); + enumerator->destroy(enumerator); + return found; } |