Raise an alert if kernel SA installation fails
authorMartin Willi <martin@revosec.ch>
Tue, 6 Nov 2012 10:32:18 +0000 (11:32 +0100)
committerMartin Willi <martin@revosec.ch>
Wed, 19 Dec 2012 09:40:33 +0000 (10:40 +0100)
src/libcharon/bus/bus.h
src/libcharon/sa/ikev2/tasks/child_create.c

index aabc0fe..1a064c3 100644 (file)
@@ -114,6 +114,8 @@ enum alert_t {
        /** traffic selectors do not match, arguments are two linked_list_t
         *  containing traffic_selector_t for initiator and for responder */
        ALERT_TS_MISMATCH,
+       /** Installation of IPsec SAs failed, argument is child_sa_t */
+       ALERT_INSTALL_CHILD_SA_FAILED,
        /** IKE_SA deleted because of "replace" unique policy, no argument */
        ALERT_UNIQUE_REPLACE,
        /** IKE_SA deleted because of "keep" unique policy, no arguement */
index 0ded7fc..ed2af43 100644 (file)
@@ -552,6 +552,8 @@ static status_t select_and_install(private_child_create_t *this,
                        (status_i != SUCCESS) ? "inbound " : "",
                        (status_i != SUCCESS && status_o != SUCCESS) ? "and ": "",
                        (status_o != SUCCESS) ? "outbound " : "");
+               charon->bus->alert(charon->bus, ALERT_INSTALL_CHILD_SA_FAILED,
+                                                  this->child_sa);
                return FAILED;
        }