On Fri, Jun 18, 2021 at 11:32:59PM +0300, Vitaliy Makkoveev wrote:
> > I would give the diff below a try.  Perhaps in snaps?
> 
> Yes please. splx(9) logic should go away at least from this layer.

So what to do with this diff?

- OK to commit?
- Test it in snaps?
- Call for testers?

I it would be interesting if the kernel is stable when trunk or
aggr interfaces are created or destroyed while the machine is under
network load.  Changing the MAC address of a physical interface
should also run through this code path.

bluhm

Index: net/if.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/net/if.c,v
retrieving revision 1.641
diff -u -p -r1.641 if.c
--- net/if.c    25 May 2021 22:45:09 -0000      1.641
+++ net/if.c    16 Jun 2021 23:46:42 -0000
@@ -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

Reply via email to