diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-02-01 13:32:01 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-02-01 13:32:01 +0000 |
commit | 95be24f55db7426698bf4a6adc583f22be43bf63 (patch) | |
tree | 1df92aaa1f7b276e107d425b7bbb92e25c346a51 /sys/net/pfkeyv2.c | |
parent | 91a9e8b618089c60f641e9a34a20666b3d665e14 (diff) |
Export per-TDB counters to userland.
This time add the counter extention to SADB_GET's whitelist.
ok bluhm@, visa@
Diffstat (limited to 'sys/net/pfkeyv2.c')
-rw-r--r-- | sys/net/pfkeyv2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index 2a89e834fcc..c0864f99369 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.c,v 1.195 2019/02/01 13:29:48 mpi Exp $ */ +/* $OpenBSD: pfkeyv2.c,v 1.196 2019/02/01 13:32:00 mpi Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -793,7 +793,8 @@ pfkeyv2_get(struct tdb *tdb, void **headers, void **buffer, int *lenp) void *p; /* Find how much space we need */ - i = sizeof(struct sadb_sa) + sizeof(struct sadb_lifetime); + i = sizeof(struct sadb_sa) + sizeof(struct sadb_lifetime) + + sizeof(struct sadb_x_counter); if (tdb->tdb_soft_allocations || tdb->tdb_soft_bytes || tdb->tdb_soft_timeout || tdb->tdb_soft_first_use) @@ -955,6 +956,9 @@ pfkeyv2_get(struct tdb *tdb, void **headers, void **buffer, int *lenp) } #endif + headers[SADB_X_EXT_COUNTER] = p; + export_counter(&p, tdb); + rval = 0; ret: |