Raise an alert if allocating virtual IPs fails
authorMartin Willi <martin@revosec.ch>
Tue, 6 Nov 2012 10:43:19 +0000 (11:43 +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/ike_config.c

index 94841f0..8dc38a8 100644 (file)
@@ -122,6 +122,8 @@ enum alert_t {
        ALERT_UNIQUE_REPLACE,
        /** IKE_SA deleted because of "keep" unique policy, no arguement */
        ALERT_UNIQUE_KEEP,
+       /** allocating virtual IP failed, linked_list_t of host_t requested */
+       ALERT_VIP_FAILURE,
 };
 
 /**
index c44f045..d637c26 100644 (file)
@@ -380,6 +380,7 @@ METHOD(task_t, build_r, status_t,
                {
                        DBG1(DBG_IKE, "no virtual IP found, sending %N",
                                 notify_type_names, INTERNAL_ADDRESS_FAILURE);
+                       charon->bus->alert(charon->bus, ALERT_VIP_FAILURE, this->vips);
                        message->add_notify(message, FALSE, INTERNAL_ADDRESS_FAILURE,
                                                                chunk_empty);
                        vips->destroy_offset(vips, offsetof(host_t, destroy));
@@ -390,6 +391,7 @@ METHOD(task_t, build_r, status_t,
                {
                        DBG1(DBG_IKE, "expected a virtual IP request, sending %N",
                                 notify_type_names, FAILED_CP_REQUIRED);
+                       charon->bus->alert(charon->bus, ALERT_VIP_FAILURE, this->vips);
                        message->add_notify(message, FALSE, FAILED_CP_REQUIRED, chunk_empty);
                        vips->destroy_offset(vips, offsetof(host_t, destroy));
                        pools->destroy(pools);