summaryrefslogtreecommitdiff
path: root/src/charon-tkm/src/ees/ees_callbacks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon-tkm/src/ees/ees_callbacks.c')
-rw-r--r--src/charon-tkm/src/ees/ees_callbacks.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/charon-tkm/src/ees/ees_callbacks.c b/src/charon-tkm/src/ees/ees_callbacks.c
index 2d9653837..74c0d3618 100644
--- a/src/charon-tkm/src/ees/ees_callbacks.c
+++ b/src/charon-tkm/src/ees/ees_callbacks.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Reto Buerki
+ * Copyright (C) 2012-2014 Reto Buerki
* Copyright (C) 2012 Adrian-Ken Rueegsegger
* Hochschule fuer Technik Rapperswil
*
@@ -19,11 +19,12 @@
#include <tkm/constants.h>
#include <tkm/types.h>
+#include "tkm.h"
#include "ees_callbacks.h"
void charon_esa_acquire(result_type *res, const sp_id_type sp_id)
{
- DBG1(DBG_KNL, "ees: acquire received for reqid {%d}", sp_id);
+ DBG1(DBG_KNL, "ees: acquire received for reqid %u", sp_id);
hydra->kernel_interface->acquire(hydra->kernel_interface, sp_id, NULL,
NULL);
*res = TKM_OK;
@@ -33,8 +34,19 @@ void charon_esa_expire(result_type *res, const sp_id_type sp_id,
const esp_spi_type spi_rem, const protocol_type protocol,
const expiry_flag_type hard)
{
- DBG1(DBG_KNL, "ees: expire received for reqid {%d}", sp_id);
- hydra->kernel_interface->expire(hydra->kernel_interface, sp_id, protocol,
- spi_rem, hard != 0);
+ host_t *dst;
+
+ dst = tkm->sad->get_dst_host(tkm->sad, sp_id, spi_rem, protocol);
*res = TKM_OK;
+ if (dst == NULL)
+ {
+ DBG3(DBG_KNL, "ees: destination host not found for reqid %u, spi %x, "
+ "proto %u", sp_id, ntohl(spi_rem), protocol);
+ return;
+ }
+
+ DBG1(DBG_KNL, "ees: expire received for reqid %u, spi %x, dst %H", sp_id,
+ ntohl(spi_rem), dst);
+ hydra->kernel_interface->expire(hydra->kernel_interface, protocol,
+ spi_rem, dst, hard != 0);
}