]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Add bool param to ALERT_KEEP_ON_CHILD_SA_FAILURE alert
authorAdrian-Ken Rueegsegger <ken@codelabs.ch>
Wed, 8 Apr 2015 16:06:51 +0000 (18:06 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 4 May 2015 16:07:29 +0000 (18:07 +0200)
The parameter indicates if the alert is raised upon failure to establish
the first CHILD SA of an IKE SA.

src/libcharon/bus/bus.h
src/libcharon/sa/ikev2/tasks/child_create.c

index 051c429f953166fc31b8bad59b4ea426aaf477cf..47b8820d30dafbfb116f6181bdd165c50d1b1376 100644 (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,
index 6d9132a68c4a07d048dba92d0dd52bfb5f63bc81..6e00ebadaa1732bbe121a5608c2f53f79ea00350 100644 (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);
        }
 }