Call pfkeyv2_sysctl_policydumper() with shared netlock. It performs
authormvs <mvs@openbsd.org>
Sat, 22 Apr 2023 20:51:56 +0000 (20:51 +0000)
committermvs <mvs@openbsd.org>
Sat, 22 Apr 2023 20:51:56 +0000 (20:51 +0000)
commita7d94c249444e27bb241c462cf5245fedbda49fc
tree8c6eab2bb32f0f6670e3b97349a472e91dac24be
parent041c7c494bbc4e07e8ba833a55d526d4bb1e9b69
Call pfkeyv2_sysctl_policydumper() with shared netlock. It performs
read-olny access to netlock protected data, so the radix tree will
not be modified during spd_table_walk() run.

Also change netlock assertion within spd_table_add() and
ipsec_delete_policy() to exclusive. These are correlating functions
which modifies radix tree, so make us sure spd_table_walk() run with
shared netlock is safe.

Feedback and ok by bluhm@
sys/net/pfkeyv2.c
sys/netinet/ip_spd.c