summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authormvs <mvs@cvs.openbsd.org>2020-08-05 11:07:35 +0000
committermvs <mvs@cvs.openbsd.org>2020-08-05 11:07:35 +0000
commit3b4523a28a3a6cb1e87cbd0e6ea89c7fd7549344 (patch)
tree621495f5f882e2a771bd65709541337e248f3477 /sys
parenta9e7ae962a47fa3c556b03f0f8b81373b37d6296 (diff)
Revert r1.614 of net/if.c. Modifications of `ifnet' list must still be
done under both the KERNEL_LOCK() and NET_LOCK().
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 41889efbe5e..42f342d7fdf 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.617 2020/08/04 09:32:05 mvs Exp $ */
+/* $OpenBSD: if.c,v 1.618 2020/08/05 11:07:34 mvs Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -523,9 +523,8 @@ void
if_attachhead(struct ifnet *ifp)
{
if_attach_common(ifp);
- KERNEL_ASSERT_LOCKED();
- TAILQ_INSERT_HEAD(&ifnet, ifp, if_list);
NET_LOCK();
+ TAILQ_INSERT_HEAD(&ifnet, ifp, if_list);
if_attachsetup(ifp);
NET_UNLOCK();
}
@@ -534,9 +533,8 @@ void
if_attach(struct ifnet *ifp)
{
if_attach_common(ifp);
- KERNEL_ASSERT_LOCKED();
- TAILQ_INSERT_TAIL(&ifnet, ifp, if_list);
NET_LOCK();
+ TAILQ_INSERT_TAIL(&ifnet, ifp, if_list);
if_attachsetup(ifp);
NET_UNLOCK();
}
@@ -1035,7 +1033,6 @@ if_detach(struct ifnet *ifp)
pfi_detach_ifnet(ifp);
#endif
- KERNEL_ASSERT_LOCKED();
/* Remove the interface from the list of all interfaces. */
TAILQ_REMOVE(&ifnet, ifp, if_list);