From: bluhm Date: Wed, 30 Jun 2021 13:23:33 +0000 (+0000) Subject: Remove splnet() from ifnewlladdr(), it is not needed anymore. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a0ebdf483a5e34be40dfa5cb0e9328e20036f8a3;p=openbsd Remove splnet() from ifnewlladdr(), it is not needed anymore. Add asserts and comments for the locks that are necessary. discussed with dlg@ mpi@ mvs@; tested by Hrvoje Popovski; OK mpi@ --- diff --git a/sys/net/if.c b/sys/net/if.c index e375f5211db..91f544e0ed3 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.641 2021/05/25 22:45:09 bluhm Exp $ */ +/* $OpenBSD: if.c,v 1.642 2021/06/30 13:23:33 bluhm Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -3107,9 +3107,10 @@ ifnewlladdr(struct ifnet *ifp) #endif struct ifreq ifrq; short up; - int s; - s = splnet(); + NET_ASSERT_LOCKED(); /* for ioctl and in6 */ + KERNEL_ASSERT_LOCKED(); /* for if_flags */ + up = ifp->if_flags & IFF_UP; if (up) { @@ -3143,7 +3144,6 @@ ifnewlladdr(struct ifnet *ifp) ifrq.ifr_flags = ifp->if_flags; (*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)&ifrq); } - splx(s); } void