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_netlink | |
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_netlink')
-rw-r--r-- | src/libhydra/plugins/kernel_netlink/kernel_netlink_ipsec.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/libhydra/plugins/kernel_netlink/kernel_netlink_ipsec.c b/src/libhydra/plugins/kernel_netlink/kernel_netlink_ipsec.c index 31bb4f656..f8077d836 100644 --- a/src/libhydra/plugins/kernel_netlink/kernel_netlink_ipsec.c +++ b/src/libhydra/plugins/kernel_netlink/kernel_netlink_ipsec.c @@ -870,25 +870,26 @@ static void process_expire(private_kernel_netlink_ipsec_t *this, struct nlmsghdr *hdr) { struct xfrm_user_expire *expire; - u_int32_t spi, reqid; + u_int32_t spi; u_int8_t protocol; + host_t *dst; expire = NLMSG_DATA(hdr); protocol = expire->state.id.proto; spi = expire->state.id.spi; - reqid = expire->state.reqid; DBG2(DBG_KNL, "received a XFRM_MSG_EXPIRE"); - if (protocol != IPPROTO_ESP && protocol != IPPROTO_AH) + if (protocol == IPPROTO_ESP || protocol == IPPROTO_AH) { - DBG2(DBG_KNL, "ignoring XFRM_MSG_EXPIRE for SA with SPI %.8x and " - "reqid {%u} which is not a CHILD_SA", ntohl(spi), reqid); - return; + dst = xfrm2host(expire->state.family, &expire->state.id.daddr, 0); + if (dst) + { + hydra->kernel_interface->expire(hydra->kernel_interface, protocol, + spi, dst, expire->hard != 0); + dst->destroy(dst); + } } - - hydra->kernel_interface->expire(hydra->kernel_interface, reqid, protocol, - spi, expire->hard != 0); } /** |