summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_ipsp.h
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-19 23:30:09 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-19 23:30:09 +0000
commite5ee354f31f6bd9db954c8a3f545781188cba650 (patch)
tree702ce9cb137070e91a69d8b5eae4227eb08a0b3d /sys/netinet/ip_ipsp.h
parent76a6da348f6aeb362a1fef371c9599904f6a3066 (diff)
There are occasions where the walker function in tdb_walk() might
sleep. So holding the tdb_sadb_mtx() when calling walker() is not allowed. Move the TDB from the TDB-Hash to a temporary list that is protected by netlock. Then unlock tdb_sadb_mtx and traverse the list to call the walker. OK mvs@
Diffstat (limited to 'sys/netinet/ip_ipsp.h')
-rw-r--r--sys/netinet/ip_ipsp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_ipsp.h b/sys/netinet/ip_ipsp.h
index b04b8dd9d73..d4d3c955975 100644
--- a/sys/netinet/ip_ipsp.h
+++ b/sys/netinet/ip_ipsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipsp.h,v 1.231 2021/12/14 17:50:37 bluhm Exp $ */
+/* $OpenBSD: ip_ipsp.h,v 1.232 2021/12/19 23:30:08 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -335,6 +335,7 @@ struct tdb { /* tunnel descriptor block */
struct tdb *tdb_snext; /* [s] src/sproto table */
struct tdb *tdb_inext;
struct tdb *tdb_onext;
+ SIMPLEQ_ENTRY(tdb) tdb_walk; /* [N] temp list for tdb walker */
struct refcnt tdb_refcnt;
struct mutex tdb_mtx;
@@ -583,7 +584,6 @@ struct tdb *gettdbbysrcdst_dir(u_int, u_int32_t, union sockaddr_union *,
void puttdb(struct tdb *);
void puttdb_locked(struct tdb *);
void tdb_delete(struct tdb *);
-void tdb_delete_locked(struct tdb *);
struct tdb *tdb_alloc(u_int);
struct tdb *tdb_ref(struct tdb *);
void tdb_unref(struct tdb *);