rt_setgate performs a series of tweaks to an rtable and the routes in
authordlg <dlg@openbsd.org>
Sun, 12 Nov 2023 15:42:05 +0000 (15:42 +0000)
committerdlg <dlg@openbsd.org>
Sun, 12 Nov 2023 15:42:05 +0000 (15:42 +0000)
commit036e77bc231459bf204c3949114809bb07a06d61
tree2047f87b8828d9245c6f60b8210c067abe5a8cb1
parenta8554c1cd2e8e540c9ca6124a30ab422d02b8153
rt_setgate performs a series of tweaks to an rtable and the routes in
the rtable which should be serialised to ensure they're consistent.
unfortunately, rt_setgate is called from the network stack while it's
only holding shared NET_LOCK.

this uses the [X] protections as described in route.h to serialise the
changes, and reworks the code to try and keep enough stuff linked up
properly during the changes that it will still work if another cpu is
still using the rtentry structs while they still have shared net lock.

tested by and ok bluhm@
sys/net/route.c