aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra/plugins/kernel_pfkey
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-03-13 11:31:36 +0100
committerMartin Willi <martin@revosec.ch>2013-03-14 14:20:54 +0100
commit7eeeb1c70226bf5738c367f9903bada5fdde7dab (patch)
treee53c67494f0ef2b56fff4672cee679687bfaa782 /src/libhydra/plugins/kernel_pfkey
parent003452d18fbc73bc048085752ee0a61656250adf (diff)
downloadstrongswan-7eeeb1c70226bf5738c367f9903bada5fdde7dab.tar.bz2
strongswan-7eeeb1c70226bf5738c367f9903bada5fdde7dab.tar.xz
kernel_ipsec_t.query_sa() additionally returns the number of processed packets
Diffstat (limited to 'src/libhydra/plugins/kernel_pfkey')
-rw-r--r--src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
index 88b028447..330fe2f1a 100644
--- a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
+++ b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
@@ -1767,7 +1767,8 @@ METHOD(kernel_ipsec_t, update_sa, status_t,
METHOD(kernel_ipsec_t, query_sa, status_t,
private_kernel_pfkey_ipsec_t *this, host_t *src, host_t *dst,
- u_int32_t spi, u_int8_t protocol, mark_t mark, u_int64_t *bytes)
+ u_int32_t spi, u_int8_t protocol, mark_t mark,
+ u_int64_t *bytes, u_int64_t *packets)
{
unsigned char request[PFKEY_BUFFER_SIZE];
struct sadb_msg *msg, *out;
@@ -1816,7 +1817,15 @@ METHOD(kernel_ipsec_t, query_sa, status_t,
free(out);
return FAILED;
}
- *bytes = response.lft_current->sadb_lifetime_bytes;
+ if (bytes)
+ {
+ *bytes = response.lft_current->sadb_lifetime_bytes;
+ }
+ if (packets)
+ {
+ /* not supported by PF_KEY */
+ *packets = 0;
+ }
free(out);
return SUCCESS;