Don't compare initiator flag in IKE_SA manager, pass initiator parameter to IKE_SA constructor

This commit is contained in:
Martin Willi
2012-03-20 17:30:47 +01:00
parent 1b99befac3
commit 17ec1c74de
5 changed files with 13 additions and 20 deletions
+3 -2
View File
@@ -2131,7 +2131,8 @@ METHOD(ike_sa_t, destroy, void,
/*
* Described in header.
*/
ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, ike_version_t version)
ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
ike_version_t version)
{
private_ike_sa_t *this;
static u_int32_t unique_id = 0;
@@ -2224,7 +2225,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, ike_version_t version)
.other_host = host_create_any(AF_INET),
.my_id = identification_create_from_encoding(ID_ANY, chunk_empty),
.other_id = identification_create_from_encoding(ID_ANY, chunk_empty),
.keymat = keymat_create(version, ike_sa_id->is_initiator(ike_sa_id)),
.keymat = keymat_create(version, initiator),
.state = IKE_CREATED,
.stats[STAT_INBOUND] = time_monotonic(NULL),
.stats[STAT_OUTBOUND] = time_monotonic(NULL),