aboutsummaryrefslogtreecommitdiffstats
path: root/src/pluto
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-09-26 10:16:30 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-09-26 10:17:01 +0200
commit2b3124c76d3897bccb4aa616fca1f7393f1b284e (patch)
tree304bc6285cb877e94708e4d9c3f02e702fe85ee3 /src/pluto
parentf0546065866d3b7c062fef4b9f30fa7f2bdcdb2a (diff)
downloadstrongswan-2b3124c76d3897bccb4aa616fca1f7393f1b284e.tar.bz2
strongswan-2b3124c76d3897bccb4aa616fca1f7393f1b284e.tar.xz
fixed release of virtual IP for XAUTH identities
Diffstat (limited to 'src/pluto')
-rw-r--r--src/pluto/connections.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pluto/connections.c b/src/pluto/connections.c
index b801ee836..2a3421961 100644
--- a/src/pluto/connections.c
+++ b/src/pluto/connections.c
@@ -297,6 +297,7 @@ void delete_connection(connection_t *c, bool relations)
{
modecfg_attribute_t *ca;
connection_t *old_cur_connection;
+ identification_t *client_id;
old_cur_connection = cur_connection == c? NULL : cur_connection;
#ifdef DEBUG
@@ -367,12 +368,14 @@ void delete_connection(connection_t *c, bool relations)
free(c->spd.that.virt);
}
+ client_id = (c->xauth_identity) ? c->xauth_identity : c->spd.that.id;
+
/* release virtual IP address lease if any */
if (c->spd.that.modecfg && c->spd.that.pool &&
!c->spd.that.host_srcip->is_anyaddr(c->spd.that.host_srcip))
{
hydra->attributes->release_address(hydra->attributes, c->spd.that.pool,
- c->spd.that.host_srcip, c->spd.that.id);
+ c->spd.that.host_srcip, client_id);
}
/* release requested attributes if any */
@@ -388,7 +391,7 @@ void delete_connection(connection_t *c, bool relations)
while (c->attributes->remove_last(c->attributes, (void **)&ca) == SUCCESS)
{
hydra->attributes->release(hydra->attributes, ca->handler,
- c->spd.that.id, ca->type, ca->value);
+ client_id, ca->type, ca->value);
modecfg_attribute_destroy(ca);
}
c->attributes->destroy(c->attributes);