ike-mobike: Always use this task for DPDs even if not behind a NAT

This allows switching to probing mode if the client is on a public IP
and this is the active task and connectivity gets restored.  We only add
NAT-D payloads if we are currently behind a NAT (to detect changed NAT
mappings), a MOBIKE update that might follow will add them in case we
move behind a NAT.
This commit is contained in:
Tobias Brunner
2018-06-22 09:20:30 +02:00
parent 35e49ffd2f
commit 3a05566d0e
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -1946,8 +1946,7 @@ METHOD(task_manager_t, queue_dpd, void,
{
ike_mobike_t *mobike;
if (this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE) &&
this->ike_sa->has_condition(this->ike_sa, COND_NAT_HERE))
if (this->ike_sa->supports_extension(this->ike_sa, EXT_MOBIKE))
{
#ifdef ME
peer_cfg_t *cfg = this->ike_sa->get_peer_cfg(this->ike_sa);
+2 -2
View File
@@ -193,7 +193,7 @@ static void process_payloads(private_ike_mobike_t *this, message_t *message)
case NAT_DETECTION_DESTINATION_IP:
{
/* NAT check in this MOBIKE exchange, create subtask for it */
if (this->natd == NULL)
if (!this->natd)
{
this->natd = ike_natd_create(this->ike_sa, this->initiator);
}
@@ -648,7 +648,7 @@ METHOD(ike_mobike_t, roam, void,
METHOD(ike_mobike_t, dpd, void,
private_ike_mobike_t *this)
{
if (!this->natd)
if (!this->natd && this->ike_sa->has_condition(this->ike_sa, COND_NAT_HERE))
{
this->natd = ike_natd_create(this->ike_sa, this->initiator);
}