There are occasions where the walker function in tdb_walk() might
authorbluhm <bluhm@openbsd.org>
Sun, 19 Dec 2021 23:30:08 +0000 (23:30 +0000)
committerbluhm <bluhm@openbsd.org>
Sun, 19 Dec 2021 23:30:08 +0000 (23:30 +0000)
commit9cb0c5826f3cb096fd9cf9db5270d23c4940a11c
treefd175d65bd46876dce77e03e0536526bb7afe4c3
parentac5276a5e712885e06bd9ac87a4e1b403eb39805
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@
sys/net/pfkeyv2.c
sys/netinet/ip_ipsp.c
sys/netinet/ip_ipsp.h