fixing a problem if the mediation server initiates the rekeying
This commit is contained in:
@@ -508,6 +508,15 @@ static void set_ike_cfg(private_ike_sa_t *this, ike_cfg_t *ike_cfg)
|
|||||||
ike_cfg->get_ref(ike_cfg);
|
ike_cfg->get_ref(ike_cfg);
|
||||||
this->ike_cfg = ike_cfg;
|
this->ike_cfg = ike_cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of ike_sa_t.is_ike_initiator
|
||||||
|
*/
|
||||||
|
static bool is_ike_initiator(private_ike_sa_t *this)
|
||||||
|
{
|
||||||
|
return this->ike_initiator;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of ike_sa_t.enable_extension.
|
* Implementation of ike_sa_t.enable_extension.
|
||||||
*/
|
*/
|
||||||
@@ -2422,6 +2431,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id)
|
|||||||
this->public.has_condition = (bool (*)(ike_sa_t*,ike_condition_t)) has_condition;
|
this->public.has_condition = (bool (*)(ike_sa_t*,ike_condition_t)) has_condition;
|
||||||
this->public.set_pending_updates = (void(*)(ike_sa_t*, u_int32_t updates))set_pending_updates;
|
this->public.set_pending_updates = (void(*)(ike_sa_t*, u_int32_t updates))set_pending_updates;
|
||||||
this->public.get_pending_updates = (u_int32_t(*)(ike_sa_t*))get_pending_updates;
|
this->public.get_pending_updates = (u_int32_t(*)(ike_sa_t*))get_pending_updates;
|
||||||
|
this->public.is_ike_initiator = (bool (*)(ike_sa_t*))is_ike_initiator;
|
||||||
this->public.create_additional_address_iterator = (iterator_t*(*)(ike_sa_t*))create_additional_address_iterator;
|
this->public.create_additional_address_iterator = (iterator_t*(*)(ike_sa_t*))create_additional_address_iterator;
|
||||||
this->public.add_additional_address = (void(*)(ike_sa_t*, host_t *host))add_additional_address;
|
this->public.add_additional_address = (void(*)(ike_sa_t*, host_t *host))add_additional_address;
|
||||||
this->public.retransmit = (status_t (*)(ike_sa_t *, u_int32_t)) retransmit;
|
this->public.retransmit = (status_t (*)(ike_sa_t *, u_int32_t)) retransmit;
|
||||||
|
|||||||
@@ -434,6 +434,13 @@ struct ike_sa_t {
|
|||||||
*/
|
*/
|
||||||
void (*set_pending_updates)(ike_sa_t *this, u_int32_t updates);
|
void (*set_pending_updates)(ike_sa_t *this, u_int32_t updates);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if we are the original initiator of this IKE_SA (rekeying does not
|
||||||
|
* change this flag).
|
||||||
|
*/
|
||||||
|
bool (*is_ike_initiator)(ike_sa_t *this);
|
||||||
|
|
||||||
|
|
||||||
#ifdef ME
|
#ifdef ME
|
||||||
/**
|
/**
|
||||||
* Activate mediation server functionality for this IKE_SA.
|
* Activate mediation server functionality for this IKE_SA.
|
||||||
|
|||||||
@@ -793,8 +793,7 @@ ike_me_t *ike_me_create(ike_sa_t *ike_sa, bool initiator)
|
|||||||
this->public.task.migrate = (void(*)(task_t*,ike_sa_t*))migrate;
|
this->public.task.migrate = (void(*)(task_t*,ike_sa_t*))migrate;
|
||||||
this->public.task.destroy = (void(*)(task_t*))destroy;
|
this->public.task.destroy = (void(*)(task_t*))destroy;
|
||||||
|
|
||||||
ike_sa_id_t *id = ike_sa->get_id(ike_sa);
|
if (ike_sa->is_ike_initiator(ike_sa))
|
||||||
if (id->is_initiator(id))
|
|
||||||
{
|
{
|
||||||
if (initiator)
|
if (initiator)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user