kernel_ipsec_t.query_sa() additionally returns the number of processed packets
This commit is contained in:
@@ -1649,7 +1649,8 @@ static void get_replay_state(private_kernel_netlink_ipsec_t *this,
|
||||
|
||||
METHOD(kernel_ipsec_t, query_sa, status_t,
|
||||
private_kernel_netlink_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)
|
||||
{
|
||||
netlink_buf_t request;
|
||||
struct nlmsghdr *out = NULL, *hdr;
|
||||
@@ -1739,7 +1740,14 @@ METHOD(kernel_ipsec_t, query_sa, status_t,
|
||||
}
|
||||
else
|
||||
{
|
||||
*bytes = sa->curlft.bytes;
|
||||
if (bytes)
|
||||
{
|
||||
*bytes = sa->curlft.bytes;
|
||||
}
|
||||
if (packets)
|
||||
{
|
||||
*packets = sa->curlft.packets;
|
||||
}
|
||||
status = SUCCESS;
|
||||
}
|
||||
memwipe(out, len);
|
||||
|
||||
Reference in New Issue
Block a user