Added a new alert that is raised if peer does not respond to initial IKE message

This commit is contained in:
Tobias Brunner 2012-10-15 13:12:43 +02:00
parent b00806cf85
commit 1d6dc62727
2 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,8 @@ enum alert_t {
ALERT_PEER_AUTH_FAILED,
/** failed to resolve peer address, no arguments */
ALERT_PEER_ADDR_FAILED,
/** peer did not respond to initial message, current try (int, 0-based) */
ALERT_PEER_INIT_UNREACHABLE,
};
/**

View File

@ -1690,6 +1690,8 @@ METHOD(ike_sa_t, retransmit, status_t,
{
/* retry IKE_SA_INIT/Main Mode if we have multiple keyingtries */
u_int32_t tries = this->peer_cfg->get_keyingtries(this->peer_cfg);
charon->bus->alert(charon->bus, ALERT_PEER_INIT_UNREACHABLE,
this->keyingtry);
this->keyingtry++;
if (tries == 0 || tries > this->keyingtry)
{