Add bool param to ALERT_KEEP_ON_CHILD_SA_FAILURE alert

The parameter indicates if the alert is raised upon failure to establish
the first CHILD SA of an IKE SA.
This commit is contained in:
Adrian-Ken Rueegsegger
2015-05-04 18:07:29 +02:00
committed by Tobias Brunner
parent 9ae6b507b9
commit 8262be3cdc
2 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -130,7 +130,8 @@ enum alert_t {
ALERT_UNIQUE_REPLACE,
/** IKE_SA deleted because of "keep" unique policy, no argument */
ALERT_UNIQUE_KEEP,
/** IKE_SA kept on failed child SA establishment, no argument */
/** IKE_SA kept on failed child SA establishment, argument is an int (!=0 if
* first child SA) */
ALERT_KEEP_ON_CHILD_SA_FAILURE,
/** allocating virtual IP failed, linked_list_t of host_t requested */
ALERT_VIP_FAILURE,
+6 -2
View File
@@ -1092,7 +1092,10 @@ METHOD(task_t, process_r, status_t,
static void handle_child_sa_failure(private_child_create_t *this,
message_t *message)
{
if (message->get_exchange_type(message) == IKE_AUTH &&
bool is_first;
is_first = message->get_exchange_type(message) == IKE_AUTH;
if (is_first &&
lib->settings->get_bool(lib->settings,
"%s.close_ike_on_child_failure", FALSE, lib->ns))
{
@@ -1106,7 +1109,8 @@ static void handle_child_sa_failure(private_child_create_t *this,
else
{
DBG1(DBG_IKE, "failed to establish CHILD_SA, keeping IKE_SA");
charon->bus->alert(charon->bus, ALERT_KEEP_ON_CHILD_SA_FAILURE);
charon->bus->alert(charon->bus, ALERT_KEEP_ON_CHILD_SA_FAILURE,
is_first);
}
}