Store IKE version of an SA on ike_sa_t.

This commit is contained in:
Tobias Brunner
2012-03-20 17:30:43 +01:00
parent 0fc9acdd23
commit 0b611540ef
7 changed files with 48 additions and 17 deletions
+4 -1
View File
@@ -54,6 +54,7 @@ METHOD(task_t, process_i, status_t,
ike_sa_t *new;
host_t *host;
enumerator_t *enumerator;
ike_version_t version;
child_sa_t *child_sa;
peer_cfg_t *peer_cfg;
@@ -74,7 +75,9 @@ METHOD(task_t, process_i, status_t,
return FAILED;
}
new = charon->ike_sa_manager->checkout_new(charon->ike_sa_manager, TRUE);
version = this->ike_sa->get_version(this->ike_sa);
new = charon->ike_sa_manager->checkout_new(charon->ike_sa_manager, version,
TRUE);
new->set_peer_cfg(new, peer_cfg);
host = this->ike_sa->get_other_host(this->ike_sa);
+6 -3
View File
@@ -129,8 +129,9 @@ METHOD(task_t, build_i, status_t,
/* create new SA only on first try */
if (this->new_sa == NULL)
{
this->new_sa = charon->ike_sa_manager->checkout_new(charon->ike_sa_manager,
TRUE);
ike_version_t version = this->ike_sa->get_version(this->ike_sa);
this->new_sa = charon->ike_sa_manager->checkout_new(
charon->ike_sa_manager, version, TRUE);
peer_cfg = this->ike_sa->get_peer_cfg(this->ike_sa);
other_host = this->ike_sa->get_other_host(this->ike_sa);
@@ -148,6 +149,7 @@ METHOD(task_t, process_r, status_t,
private_ike_rekey_t *this, message_t *message)
{
enumerator_t *enumerator;
ike_version_t version;
peer_cfg_t *peer_cfg;
child_sa_t *child_sa;
@@ -175,8 +177,9 @@ METHOD(task_t, process_r, status_t,
}
enumerator->destroy(enumerator);
version = this->ike_sa->get_version(this->ike_sa);
this->new_sa = charon->ike_sa_manager->checkout_new(charon->ike_sa_manager,
FALSE);
version, FALSE);
peer_cfg = this->ike_sa->get_peer_cfg(this->ike_sa);
this->new_sa->set_peer_cfg(this->new_sa, peer_cfg);