Assert that ifnet_detach_sxlock is held where needed.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D41770
This commit is contained in:
Dag-Erling Smørgrav 2023-09-08 10:06:01 +00:00
parent 17c17872ca
commit 9a071e4e57

View file

@ -1128,6 +1128,8 @@ if_detach_internal(struct ifnet *ifp, bool vmove)
shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet);
#endif
sx_assert(&ifnet_detach_sxlock, SX_XLOCKED);
/*
* At this point we know the interface still was on the ifnet list
* and we removed it so we are in a stable state.