diff --git a/src/libcharon/attributes/mem_pool.c b/src/libcharon/attributes/mem_pool.c index 9fca4645c..d2dd0d83c 100644 --- a/src/libcharon/attributes/mem_pool.c +++ b/src/libcharon/attributes/mem_pool.c @@ -307,8 +307,9 @@ static int get_existing(private_mem_pool_t *this, identification_t *id, enumerator = array_create_enumerator(entry->online); while (enumerator->enumerate(enumerator, &lease)) { - if (lease->offset == host2offset(this, requested) && - lease->hash == hash_addr(peer)) + if (lease->hash == hash_addr(peer) && + (requested->is_anyaddr(requested) || + lease->offset == host2offset(this, requested))) { offset = lease->offset; /* add an additional "online" entry */