diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-03-22 09:52:39 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-03-22 09:52:39 +0000 |
commit | 7a229aeb240cc750546f55ad089022f0ca7dc44f (patch) | |
tree | d1767cb9d72b52a79a5b74e570fd57d0a0e87c1c /src/charon/config/attributes | |
parent | 19364e11c66714324bd3d5d0dc9212db397085cb (diff) | |
download | vyos-strongswan-7a229aeb240cc750546f55ad089022f0ca7dc44f.tar.gz vyos-strongswan-7a229aeb240cc750546f55ad089022f0ca7dc44f.zip |
[svn-upgrade] Integrating new upstream version, strongswan (4.2.13)
Diffstat (limited to 'src/charon/config/attributes')
-rw-r--r-- | src/charon/config/attributes/attribute_manager.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/charon/config/attributes/attribute_manager.c b/src/charon/config/attributes/attribute_manager.c index b919c4261..a069c954a 100644 --- a/src/charon/config/attributes/attribute_manager.c +++ b/src/charon/config/attributes/attribute_manager.c @@ -17,6 +17,7 @@ #include "attribute_manager.h" +#include <daemon.h> #include <utils/linked_list.h> #include <utils/mutex.h> @@ -53,7 +54,7 @@ static host_t* acquire_address(private_attribute_manager_t *this, enumerator_t *enumerator; attribute_provider_t *current; host_t *host = NULL; - + this->lock->read_lock(this->lock); enumerator = this->providers->create_enumerator(this->providers); while (enumerator->enumerate(enumerator, ¤t)) @@ -67,6 +68,10 @@ static host_t* acquire_address(private_attribute_manager_t *this, enumerator->destroy(enumerator); this->lock->unlock(this->lock); + if (!host) + { + DBG1(DBG_CFG, "acquiring address from pool '%s' failed", pool); + } return host; } @@ -78,18 +83,25 @@ static void release_address(private_attribute_manager_t *this, { enumerator_t *enumerator; attribute_provider_t *current; - + bool found = FALSE; + this->lock->read_lock(this->lock); enumerator = this->providers->create_enumerator(this->providers); while (enumerator->enumerate(enumerator, ¤t)) { if (current->release_address(current, pool, address, id)) { + found = TRUE; break; } } enumerator->destroy(enumerator); this->lock->unlock(this->lock); + + if (!found) + { + DBG1(DBG_CFG, "releasing address to pool '%s' failed", pool); + } } /** |