Module Name: src Committed By: riastradh Date: Fri Dec 31 14:26:09 UTC 2021
Modified Files: src/sys/net: if_ethersubr.c Log Message: ethersubr(9): Assert IFNET_LOCKED in ether_ioctl_reinit. Changes to if_flags are nontrivial configuration changes that require the long-term ioctl lock. To generate a diff of this commit: cvs rdiff -u -r1.309 -r1.310 src/sys/net/if_ethersubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_ethersubr.c diff -u src/sys/net/if_ethersubr.c:1.309 src/sys/net/if_ethersubr.c:1.310 --- src/sys/net/if_ethersubr.c:1.309 Fri Dec 31 14:25:24 2021 +++ src/sys/net/if_ethersubr.c Fri Dec 31 14:26:09 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ethersubr.c,v 1.309 2021/12/31 14:25:24 riastradh Exp $ */ +/* $NetBSD: if_ethersubr.c,v 1.310 2021/12/31 14:26:09 riastradh Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.309 2021/12/31 14:25:24 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.310 2021/12/31 14:26:09 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1455,6 +1455,8 @@ ether_ioctl_reinit(struct ethercom *ec) struct ifnet *ifp = &ec->ec_if; int error; + KASSERTMSG(IFNET_LOCKED(ifp), "%s", ifp->if_xname); + switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) { case IFF_RUNNING: /*