Destroying lo(4) interfaces checks for other interfaces in the same
rdomain(4) first which does not modify anything, so allow other readers.
All interface ioctl(2)s currently run with the kernel lock held, so this
should not make a real difference...
OK mvs
-/* $OpenBSD: if_loop.c,v 1.92 2022/09/08 10:22:06 kn Exp $ */
+/* $OpenBSD: if_loop.c,v 1.93 2022/10/21 14:20:03 kn Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
return (EPERM);
/* if there is any other interface in this rdomain, deny */
- NET_LOCK();
+ NET_LOCK_SHARED();
TAILQ_FOREACH(p, &ifnetlist, if_list) {
if (p->if_rdomain != ifp->if_rdomain)
continue;
if (p->if_index == ifp->if_index)
continue;
- NET_UNLOCK();
+ NET_UNLOCK_SHARED();
return (EBUSY);
}
- NET_UNLOCK();
+ NET_UNLOCK_SHARED();
rdomain = ifp->if_rdomain;
}