diff options
author | Martin Willi <martin@revosec.ch> | 2013-04-17 11:09:23 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-05-06 14:56:01 +0200 |
commit | a3854d8371b227002fa92cef0c8a3eb30eba7783 (patch) | |
tree | d47b5684a0f66bbbedf1fdfda7a3164deb0e873d /src | |
parent | 55321dcfb6898efacb696ac4b03db51dd1fb9219 (diff) | |
download | strongswan-a3854d8371b227002fa92cef0c8a3eb30eba7783.tar.bz2 strongswan-a3854d8371b227002fa92cef0c8a3eb30eba7783.tar.xz |
Don't unset IKE_SA on bus before we released virtual IPs and attributes
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/sa/ike_sa.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c index 63c04d9c0..d7a9076b8 100644 --- a/src/libcharon/sa/ike_sa.c +++ b/src/libcharon/sa/ike_sa.c @@ -2094,21 +2094,11 @@ METHOD(ike_sa_t, destroy, void, free(entry->data.ptr); free(entry); } - this->attributes->destroy(this->attributes); - - this->child_sas->destroy_offset(this->child_sas, offsetof(child_sa_t, destroy)); - - /* unset SA after here to avoid usage by the listeners */ - charon->bus->set_sa(charon->bus, NULL); - - DESTROY_IF(this->keymat); - while (this->my_vips->remove_last(this->my_vips, (void**)&vip) == SUCCESS) { hydra->kernel_interface->del_ip(hydra->kernel_interface, vip, -1, TRUE); vip->destroy(vip); } - this->my_vips->destroy(this->my_vips); if (this->other_vips->get_count(this->other_vips)) { charon->bus->assign_vips(charon->bus, &this->public, FALSE); @@ -2129,6 +2119,14 @@ METHOD(ike_sa_t, destroy, void, } vip->destroy(vip); } + + /* unset SA after here to avoid usage by the listeners */ + charon->bus->set_sa(charon->bus, NULL); + + this->child_sas->destroy_offset(this->child_sas, offsetof(child_sa_t, destroy)); + DESTROY_IF(this->keymat); + this->attributes->destroy(this->attributes); + this->my_vips->destroy(this->my_vips); this->other_vips->destroy(this->other_vips); this->peer_addresses->destroy_offset(this->peer_addresses, offsetof(host_t, destroy)); |