summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.c
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2021-12-20 15:59:11 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2021-12-20 15:59:11 +0000
commit30e42e456d6df328420de84fe07366e2edf7a1cd (patch)
tree3d444eda21441a3cc106e39f2e58679ae3a4a0aa /sys/netinet/ip_ipsp.c
parent51b217bfc57215cefe203cedd8bc9a96965ebb04 (diff)
Use per-CPU counters for tunnel descriptor block (TDB) statistics.
'tdb_data' struct became unused and was removed. Tested by Hrvoje Popovski. ok bluhm@
Diffstat (limited to 'sys/netinet/ip_ipsp.c')
-rw-r--r--sys/netinet/ip_ipsp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c
index f7b4a9c5742..66baca79efc 100644
--- a/sys/netinet/ip_ipsp.c
+++ b/sys/netinet/ip_ipsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.c,v 1.266 2021/12/19 23:30:08 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.c,v 1.267 2021/12/20 15:59:09 mvs Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -1050,6 +1050,9 @@ tdb_alloc(u_int rdomain)
tdbp->tdb_rdomain = rdomain;
tdbp->tdb_rdomain_post = rdomain;
+ /* Initialize counters. */
+ tdbp->tdb_counters = counters_alloc(tdb_ncounters);
+
/* Initialize timeouts. */
timeout_set_proc(&tdbp->tdb_timer_tmo, tdb_timeout, tdbp);
timeout_set_proc(&tdbp->tdb_first_tmo, tdb_firstuse, tdbp);
@@ -1088,6 +1091,8 @@ tdb_free(struct tdb *tdbp)
}
#endif
+ counters_free(tdbp->tdb_counters, tdb_ncounters);
+
KASSERT(tdbp->tdb_onext == NULL);
KASSERT(tdbp->tdb_inext == NULL);