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:
committed by
Tobias Brunner
parent
9ae6b507b9
commit
8262be3cdc
@@ -130,7 +130,8 @@ enum alert_t {
|
|||||||
ALERT_UNIQUE_REPLACE,
|
ALERT_UNIQUE_REPLACE,
|
||||||
/** IKE_SA deleted because of "keep" unique policy, no argument */
|
/** IKE_SA deleted because of "keep" unique policy, no argument */
|
||||||
ALERT_UNIQUE_KEEP,
|
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,
|
ALERT_KEEP_ON_CHILD_SA_FAILURE,
|
||||||
/** allocating virtual IP failed, linked_list_t of host_t requested */
|
/** allocating virtual IP failed, linked_list_t of host_t requested */
|
||||||
ALERT_VIP_FAILURE,
|
ALERT_VIP_FAILURE,
|
||||||
|
|||||||
@@ -1092,7 +1092,10 @@ METHOD(task_t, process_r, status_t,
|
|||||||
static void handle_child_sa_failure(private_child_create_t *this,
|
static void handle_child_sa_failure(private_child_create_t *this,
|
||||||
message_t *message)
|
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,
|
lib->settings->get_bool(lib->settings,
|
||||||
"%s.close_ike_on_child_failure", FALSE, lib->ns))
|
"%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
|
else
|
||||||
{
|
{
|
||||||
DBG1(DBG_IKE, "failed to establish CHILD_SA, keeping IKE_SA");
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user