Implement reference counting for IPsec tdbs. Not all cases are
authorbluhm <bluhm@openbsd.org>
Thu, 25 Nov 2021 13:46:02 +0000 (13:46 +0000)
committerbluhm <bluhm@openbsd.org>
Thu, 25 Nov 2021 13:46:02 +0000 (13:46 +0000)
commit4b0e5db302209284feee6c09c003f585d1261f04
tree8daeea55615b7b3daeb5b56f0ea0d42a1aac3e5f
parented3d011490736316a8ee7b905d1b925e862fe4ed
Implement reference counting for IPsec tdbs.  Not all cases are
covered yet, more ref counts to come.  The timeouts are protected,
so the racy tdb_reaper() gets retired.  The tdb_policy_head, onext
and inext lists are protected.  All gettdb...() functions return a
tdb that is ref counted and has to be unrefed later.  A flag ensures
that tdb_delete() is called only once.
Tested by Hrvoje Popovski; OK sthen@ mvs@ tobhe@
12 files changed:
sys/net/if_bridge.c
sys/net/if_pfsync.c
sys/net/pfkeyv2.c
sys/net/pfkeyv2_convert.c
sys/netinet/ip_ipsp.c
sys/netinet/ip_ipsp.h
sys/netinet/ip_spd.c
sys/netinet/ipsec_input.c
sys/netinet/ipsec_output.c
sys/netinet/tcp_input.c
sys/netinet/tcp_output.c
sys/netinet/udp_usrreq.c