From: Reto Buerki Date: Fri, 19 Dec 2014 08:11:12 +0000 (+0100) Subject: charon-tkm: Use get_dst_host getter in EES callback X-Git-Tag: 5.3.0dr1~80^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fb42bc87f68970916f2d8d64026462446879f4b;p=thirdparty%2Fstrongswan.git charon-tkm: Use get_dst_host getter in EES callback Use the new get_dst_host getter to retrieve the destination host from the SAD using the reqid, spi and protocol values received from the xfrm-proxy. --- diff --git a/src/charon-tkm/src/ees/ees_callbacks.c b/src/charon-tkm/src/ees/ees_callbacks.c index 8650947f87..74c0d3618a 100644 --- a/src/charon-tkm/src/ees/ees_callbacks.c +++ b/src/charon-tkm/src/ees/ees_callbacks.c @@ -19,11 +19,12 @@ #include #include +#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,10 +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) { - host_t *dst = NULL; + host_t *dst; - DBG1(DBG_KNL, "ees: expire received for reqid {%d}", sp_id); + 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); - *res = TKM_OK; }