From 01a8b40b99a5943a08b1488a1a75c351593b51b7 Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Thu, 8 Jan 2009 21:34:44 +0000 Subject: [PATCH] fixed two bugs introduced by the stroke ip pool refactoring --- src/charon/plugins/stroke/stroke_attribute.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/charon/plugins/stroke/stroke_attribute.c b/src/charon/plugins/stroke/stroke_attribute.c index 666d948d69..7996fb349a 100644 --- a/src/charon/plugins/stroke/stroke_attribute.c +++ b/src/charon/plugins/stroke/stroke_attribute.c @@ -194,7 +194,7 @@ static host_t* acquire_address(private_stroke_attribute_t *this, auth_info_t *auth, host_t *requested) { pool_t *pool; - uintptr_t offset; + uintptr_t offset = 0; enumerator_t *enumerator; identification_t *old_id; @@ -202,6 +202,13 @@ static host_t* acquire_address(private_stroke_attribute_t *this, pool = find_pool(this, name); while (pool) { + /* handle %config case by mirroring requested address */ + if (pool->size == 0) + { + this->mutex->unlock(this->mutex); + return requested->clone(requested); + } + /* check for a valid offline lease, refresh */ offset = (uintptr_t)pool->offline->remove(pool->offline, id); if (offset) @@ -291,7 +298,7 @@ static bool release_address(private_stroke_attribute_t *this, id = pool->ids->get(pool->ids, id); if (id) { - DBG1(DBG_CFG, "lease %H of %D gone offline", address, id); + DBG1(DBG_CFG, "lease %H to %D went offline", address, id); pool->offline->put(pool->offline, id, (void*)offset); } } -- 2.47.2