From 4e06abe0fafd8590da4cd83f1c435947e0561a82 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 31 Mar 2010 10:17:51 +0200 Subject: [PATCH] Delete the in-memory IP address pools if a connection gets deleted. This fixes ipsec reload. --- src/pluto/connections.c | 5 +++++ src/pluto/whack_attribute.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/pluto/connections.c b/src/pluto/connections.c index 38803ea65..b6ba57c4c 100644 --- a/src/pluto/connections.c +++ b/src/pluto/connections.c @@ -376,6 +376,11 @@ void delete_connection(connection_t *c, bool relations) vip->destroy(vip); } + if (c->kind != CK_GOING_AWAY) + { + whack_attr->del_pool(whack_attr, c->name); + } + /* free internal data */ #ifdef DEBUG cur_debugging = old_cur_debugging; diff --git a/src/pluto/whack_attribute.c b/src/pluto/whack_attribute.c index 2ccfdb3e8..fcb5c13cb 100644 --- a/src/pluto/whack_attribute.c +++ b/src/pluto/whack_attribute.c @@ -160,6 +160,9 @@ METHOD(whack_attribute_t, del_pool, void, { if (streq(name, pool->get_name(pool))) { + DBG(DBG_CONTROL, + DBG_log("deleting virtual IP address pool '%s'", name) + ); this->pools->remove_at(this->pools, enumerator); pool->destroy(pool); break;