]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
bus: Add a boolean argument to PROPSAL_MISMATCH_* alerts to indicate origin
authorMartin Willi <martin@revosec.ch>
Tue, 2 Jun 2015 09:03:40 +0000 (11:03 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 29 Jun 2015 07:22:50 +0000 (09:22 +0200)
src/libcharon/bus/bus.h
src/libcharon/sa/ikev2/tasks/child_create.c
src/libcharon/sa/ikev2/tasks/ike_init.c

index b6757b140939118176633a40bb25411893d63805..148c76fabe7179e55855a3df0897ea543aa9e8ec 100644 (file)
@@ -111,9 +111,11 @@ enum alert_t {
        ALERT_RETRANSMIT_RECEIVE,
        /** received half-open timeout before IKE_SA established, no argument */
        ALERT_HALF_OPEN_TIMEOUT,
-       /** IKE proposals do not match, argument is linked_list_t of proposal_t */
+       /** IKE proposals do not match, arguments are linked_list_t of proposal_t,
+        *  followed by a bool set to TRUE if mismatch is local. */
        ALERT_PROPOSAL_MISMATCH_IKE,
-       /** CHILD proposals do not match, argument is linked_list_t of proposal_t */
+       /** CHILD proposals do not match, argument is linked_list_t of proposal_t,
+        *  followed by a bool set to TRUE if mismatch is local. */
        ALERT_PROPOSAL_MISMATCH_CHILD,
        /** traffic selectors do not match, arguments are two linked_list_t
         *  containing traffic_selector_t for initiator and for responder */
index e0f930c3c7ea4473921da8c454d423913f0373f4..d5c5e3cffd30cf3294f52cbf7c809ed690b6a993 100644 (file)
@@ -483,7 +483,7 @@ static status_t select_and_install(private_child_create_t *this,
        {
                DBG1(DBG_IKE, "no acceptable proposal found");
                charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_CHILD,
-                                                  this->proposals);
+                                                  this->proposals, TRUE);
                return FAILED;
        }
        this->other_spi = this->proposal->get_spi(this->proposal);
@@ -1340,7 +1340,8 @@ static void raise_alerts(private_child_create_t *this, notify_type_t type)
        {
                case NO_PROPOSAL_CHOSEN:
                        list = this->config->get_proposals(this->config, FALSE);
-                       charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_CHILD, list);
+                       charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_CHILD,
+                                                          list, FALSE);
                        list->destroy_offset(list, offsetof(proposal_t, destroy));
                        break;
                default:
index 1ff643d62ca789aa589c9d57a387168635d7aebd..8b7ebb8f6cee6a1b901fcad8b5e8d7a475e5bc13 100644 (file)
@@ -355,7 +355,7 @@ static void process_payloads(private_ike_init_t *this, message_t *message)
                                if (!this->proposal)
                                {
                                        charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_IKE,
-                                                                          proposal_list);
+                                                                          proposal_list, TRUE);
                                }
                                proposal_list->destroy_offset(proposal_list,
                                                                                          offsetof(proposal_t, destroy));
@@ -615,7 +615,8 @@ static void raise_alerts(private_ike_init_t *this, notify_type_t type)
        {
                case NO_PROPOSAL_CHOSEN:
                        list = this->config->get_proposals(this->config);
-                       charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_IKE, list);
+                       charon->bus->alert(charon->bus, ALERT_PROPOSAL_MISMATCH_IKE,
+                                                          list, FALSE);
                        list->destroy_offset(list, offsetof(proposal_t, destroy));
                        break;
                default: