summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-04-08 13:49:39 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-04-08 13:49:39 +0000
commit84334a7788193c33af42bfd18170d5eef74ae8c5 (patch)
treea0113bc7c8e9e653ae7ff7e55112b13dce937100
parent9eba0c6f9836ebdf4dc6c558729189a3e2ea3186 (diff)
Move rtm_ifannounce(IFAN_DEPARTURE) outside netlock within if_detach().
This is the mbuf(9) allocation and broadcast transmission for PF_ROUTE sockets, netlock is not required here. ok bluhm@
-rw-r--r--sys/net/if.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index ab0ec63c61a..e4675704a3b 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.687 2023/04/07 22:02:58 bluhm Exp $ */
+/* $OpenBSD: if.c,v 1.688 2023/04/08 13:49:38 mvs Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1125,11 +1125,11 @@ 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);
- splx(s);
- NET_UNLOCK();
if (ifp->if_counters != NULL)
if_counters_free(ifp);