Raise an alert if allocating virtual IPs fails

This commit is contained in:
Martin Willi 2012-11-06 11:43:19 +01:00
parent f285b9efc8
commit 45d6134218
2 changed files with 4 additions and 0 deletions

View 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,
};
/**

View 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);