From fa0c4e6617f993cc56c1503bd2606152b3a6df75 Mon Sep 17 00:00:00 2001 From: mvs Date: Sat, 8 Apr 2023 13:49:38 +0000 Subject: [PATCH] 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@ --- sys/net/if.c | 6 +++--- 1 file 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); -- 2.20.1