Trigger DPD not before IKE_SA state gets updated
This commit is contained in:
@@ -619,6 +619,8 @@ METHOD(ike_sa_t, get_state, ike_sa_state_t,
|
||||
METHOD(ike_sa_t, set_state, void,
|
||||
private_ike_sa_t *this, ike_sa_state_t state)
|
||||
{
|
||||
bool trigger_dpd = FALSE;
|
||||
|
||||
DBG2(DBG_IKE, "IKE_SA %s[%d] state change: %N => %N",
|
||||
get_name(this), this->unique_id,
|
||||
ike_sa_state_names, this->state,
|
||||
@@ -679,12 +681,7 @@ METHOD(ike_sa_t, set_state, void,
|
||||
lib->scheduler->schedule_job(lib->scheduler, job, t);
|
||||
DBG1(DBG_IKE, "maximum IKE_SA lifetime %ds", t);
|
||||
}
|
||||
|
||||
/* start DPD checks */
|
||||
if (this->peer_cfg->get_dpd(this->peer_cfg))
|
||||
{
|
||||
send_dpd(this);
|
||||
}
|
||||
trigger_dpd = this->peer_cfg->get_dpd(this->peer_cfg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -701,6 +698,11 @@ METHOD(ike_sa_t, set_state, void,
|
||||
}
|
||||
charon->bus->ike_state_change(charon->bus, &this->public, state);
|
||||
this->state = state;
|
||||
|
||||
if (trigger_dpd)
|
||||
{
|
||||
send_dpd(this);
|
||||
}
|
||||
}
|
||||
|
||||
METHOD(ike_sa_t, reset, void,
|
||||
|
||||
Reference in New Issue
Block a user