summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.h
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-11 16:33:48 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-11 16:33:48 +0000
commit3977b0a4af8da10231f57600e67f6746e537c6b4 (patch)
tree220ba8d883865e1585f665a7183c7e21cf795163 /sys/netinet/ip_ipsp.h
parentcb175529c51547f1292106965a1c442c9a2ce7c9 (diff)
Protect the write access to the TDB flags field with a mutex per
TDB. Clearing the timeout flags just before pool put in tdb_free() does not make sense. Move this to tdb_delete(). While there make the parentheses in the flag check consistent. tested by Hrvoje Popovski; OK tobhe@
Diffstat (limited to 'sys/netinet/ip_ipsp.h')
-rw-r--r--sys/netinet/ip_ipsp.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h
index f8ccdbf5c24..fd822cfb9f8 100644
--- a/sys/netinet/ip_ipsp.h
+++ b/sys/netinet/ip_ipsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.h,v 1.229 2021/12/08 14:24:18 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.230 2021/12/11 16:33:47 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -314,6 +314,7 @@ struct ipsec_policy {
* I immutable after creation
* N net lock
* s tdb_sadb_mtx
+ * m tdb_mtx
*/
struct tdb { /* tunnel descriptor block */
/*
@@ -331,6 +332,7 @@ struct tdb { /* tunnel descriptor block */
struct tdb *tdb_onext;
struct refcnt tdb_refcnt;
+ struct mutex tdb_mtx;
const struct xformsw *tdb_xform; /* Transform to use */
const struct enc_xform *tdb_encalgxform; /* Enc algorithm */
@@ -364,7 +366,7 @@ struct tdb { /* tunnel descriptor block */
"\21USEDTUNNEL\22UDPENCAP\23PFSYNC\24PFSYNC_RPL" \
"\25ESN")
- u_int32_t tdb_flags; /* Flags related to this TDB */
+ u_int32_t tdb_flags; /* [m] Flags related to this TDB */
struct timeout tdb_timer_tmo;
struct timeout tdb_first_tmo;