aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa/ike_sa.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-04-10 10:21:32 +0200
committerMartin Willi <martin@revosec.ch>2014-04-17 09:24:51 +0200
commit713a1122b4f262536f72b9e0b2733383d1540658 (patch)
tree47678053d83346eaeea7399e80d9ca3e8f312578 /src/libcharon/sa/ike_sa.c
parentc4c9d291d2aaeccf9d36971de763b0ab60af9e66 (diff)
downloadstrongswan-713a1122b4f262536f72b9e0b2733383d1540658.tar.bz2
strongswan-713a1122b4f262536f72b9e0b2733383d1540658.tar.xz
ikev2: Add inherit_pre() to apply config and hosts before IKE_SA rekeying
Diffstat (limited to 'src/libcharon/sa/ike_sa.c')
-rw-r--r--src/libcharon/sa/ike_sa.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
index 2c15dc5eb..4b4c1ceb9 100644
--- a/src/libcharon/sa/ike_sa.c
+++ b/src/libcharon/sa/ike_sa.c
@@ -2019,7 +2019,18 @@ METHOD(ike_sa_t, queue_task, void,
this->task_manager->queue_task(this->task_manager, task);
}
-METHOD(ike_sa_t, inherit, void,
+METHOD(ike_sa_t, inherit_pre, void,
+ private_ike_sa_t *this, ike_sa_t *other_public)
+{
+ private_ike_sa_t *other = (private_ike_sa_t*)other_public;
+
+ /* apply config and hosts */
+ set_peer_cfg(this, other->peer_cfg);
+ set_my_host(this, other->my_host->clone(other->my_host));
+ set_other_host(this, other->other_host->clone(other->other_host));
+}
+
+METHOD(ike_sa_t, inherit_post, void,
private_ike_sa_t *this, ike_sa_t *other_public)
{
private_ike_sa_t *other = (private_ike_sa_t*)other_public;
@@ -2288,7 +2299,8 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
.reestablish = _reestablish,
.set_auth_lifetime = _set_auth_lifetime,
.roam = _roam,
- .inherit = _inherit,
+ .inherit_pre = _inherit_pre,
+ .inherit_post = _inherit_post,
.generate_message = _generate_message,
.reset = _reset,
.get_unique_id = _get_unique_id,