Disable DPD checking for peers not supporting it

This commit is contained in:
Martin Willi
2012-03-20 17:31:35 +01:00
parent 214d4e4090
commit 11aadd7722
3 changed files with 20 additions and 3 deletions
+13 -1
View File
@@ -670,7 +670,14 @@ METHOD(ike_sa_t, set_state, void,
/* start DPD checks */
if (this->peer_cfg->get_dpd(this->peer_cfg))
{
send_dpd(this);
if (supports_extension(this, EXT_DPD))
{
send_dpd(this);
}
else
{
DBG1(DBG_IKE, "DPD not supported by peer, disabled");
}
}
}
break;
@@ -2037,6 +2044,11 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
"charon.flush_auth_cfg", FALSE),
);
if (version == IKEV2)
{ /* always supported with IKEv2 */
enable_extension(this, EXT_DPD);
}
this->task_manager = task_manager_create(&this->public);
this->my_host->set_port(this->my_host, IKEV2_UDP_PORT);