diff options
author | Martin Willi <martin@revosec.ch> | 2014-10-27 15:07:05 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2015-02-20 13:34:50 +0100 |
commit | f81a9497483a7282c11adf5705d9ea3e83f6fffd (patch) | |
tree | 8414a9b7e0eec4ae56fdcfa1447bd1e7f432504d /src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c | |
parent | 971a91685da640363651e7a9a9edb9dfd94b7fe5 (diff) | |
download | strongswan-f81a9497483a7282c11adf5705d9ea3e83f6fffd.tar.bz2 strongswan-f81a9497483a7282c11adf5705d9ea3e83f6fffd.tar.xz |
kernel-interface: Raise expires with a proto/SPI/dst tuple instead of reqid
Diffstat (limited to 'src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c')
-rw-r--r-- | src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c index 348549bfa..9b846864e 100644 --- a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c +++ b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c @@ -1296,7 +1296,8 @@ static void process_expire(private_kernel_pfkey_ipsec_t *this, { pfkey_msg_t response; u_int8_t protocol; - u_int32_t spi, reqid; + u_int32_t spi; + host_t *dst; bool hard; DBG2(DBG_KNL, "received an SADB_EXPIRE"); @@ -1309,18 +1310,18 @@ static void process_expire(private_kernel_pfkey_ipsec_t *this, protocol = satype2proto(msg->sadb_msg_satype); spi = response.sa->sadb_sa_spi; - reqid = response.x_sa2->sadb_x_sa2_reqid; hard = response.lft_hard != NULL; - if (protocol != IPPROTO_ESP && protocol != IPPROTO_AH) + if (protocol == IPPROTO_ESP || protocol == IPPROTO_AH) { - DBG2(DBG_KNL, "ignoring SADB_EXPIRE for SA with SPI %.8x and " - "reqid {%u} which is not a CHILD_SA", ntohl(spi), reqid); - return; + dst = host_create_from_sockaddr((sockaddr_t*)(response.dst + 1)); + if (dst) + { + hydra->kernel_interface->expire(hydra->kernel_interface, protocol, + spi, dst, hard); + dst->destroy(dst); + } } - - hydra->kernel_interface->expire(hydra->kernel_interface, reqid, protocol, - spi, hard); } #ifdef SADB_X_MIGRATE |