From: mvs Date: Mon, 12 Jun 2023 21:19:54 +0000 (+0000) Subject: Move nd6_ifdetach() out of netlock. In this point, the interface is X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=86c3cfc03bf64a795f46bcbd96fc0a1a8990d24d;p=openbsd Move nd6_ifdetach() out of netlock. In this point, the interface is disconnected from everywhere. No need to hold netlock for dummy 'nd_ifinfo' release. Netlock is also not needed for TAILQ_EMPTY(&ifp->if_*hooks) assertions. ok kn bluhm --- diff --git a/sys/net/if.c b/sys/net/if.c index 208dd448382..a4755f6b91b 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.699 2023/06/05 11:35:46 bluhm Exp $ */ +/* $OpenBSD: if.c,v 1.700 2023/06/12 21:19:54 mvs Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1170,6 +1170,8 @@ if_detach(struct ifnet *ifp) ifafree(ifa); } } + splx(s); + NET_UNLOCK(); KASSERT(TAILQ_EMPTY(&ifp->if_addrhooks)); KASSERT(TAILQ_EMPTY(&ifp->if_linkstatehooks)); @@ -1178,8 +1180,6 @@ if_detach(struct ifnet *ifp) #ifdef INET6 nd6_ifdetach(ifp); #endif - splx(s); - NET_UNLOCK(); /* Announce that the interface is gone. */ rtm_ifannounce(ifp, IFAN_DEPARTURE);