diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-03-17 09:58:00 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-03-19 09:54:03 +0100 |
commit | 46188b0eb0f1d2bc6e44dd1215e0b396dcab3d33 (patch) | |
tree | 4651e93427b32b864fcdf5a00b2eebdefae34c3b | |
parent | c5f4e7c69e0774154c6a1645e6c868f96fd27c1a (diff) | |
download | strongswan-46188b0eb0f1d2bc6e44dd1215e0b396dcab3d33.tar.bz2 strongswan-46188b0eb0f1d2bc6e44dd1215e0b396dcab3d33.tar.xz |
child-sa: Remove policies before states to avoid acquire events for untrapped policies
-rw-r--r-- | src/libcharon/sa/child_sa.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/libcharon/sa/child_sa.c b/src/libcharon/sa/child_sa.c index 9c74b9517..068092d60 100644 --- a/src/libcharon/sa/child_sa.c +++ b/src/libcharon/sa/child_sa.c @@ -1114,22 +1114,6 @@ METHOD(child_sa_t, destroy, void, set_state(this, CHILD_DESTROYING); - /* delete SAs in the kernel, if they are set up */ - if (this->my_spi) - { - hydra->kernel_interface->del_sa(hydra->kernel_interface, - this->other_addr, this->my_addr, this->my_spi, - proto_ike2ip(this->protocol), this->my_cpi, - this->mark_in); - } - if (this->other_spi) - { - hydra->kernel_interface->del_sa(hydra->kernel_interface, - this->my_addr, this->other_addr, this->other_spi, - proto_ike2ip(this->protocol), this->other_cpi, - this->mark_out); - } - if (this->config->install_policy(this->config)) { /* delete all policies in the kernel */ @@ -1146,6 +1130,22 @@ METHOD(child_sa_t, destroy, void, enumerator->destroy(enumerator); } + /* delete SAs in the kernel, if they are set up */ + if (this->my_spi) + { + hydra->kernel_interface->del_sa(hydra->kernel_interface, + this->other_addr, this->my_addr, this->my_spi, + proto_ike2ip(this->protocol), this->my_cpi, + this->mark_in); + } + if (this->other_spi) + { + hydra->kernel_interface->del_sa(hydra->kernel_interface, + this->my_addr, this->other_addr, this->other_spi, + proto_ike2ip(this->protocol), this->other_cpi, + this->mark_out); + } + if (this->reqid_allocated) { if (hydra->kernel_interface->release_reqid(hydra->kernel_interface, |