Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[.joined/src/trunk]: .joined/src/sys/net ethersubr(9): Assert IFNET_LOCKED in...



details:   https://anonhg.NetBSD.org/.joined/src/rev/ba7dee30cb5a
branches:  trunk
changeset: 359346:ba7dee30cb5a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Dec 31 14:26:09 2021 +0000

description:
ethersubr(9): Assert IFNET_LOCKED in ether_ioctl_reinit.

Changes to if_flags are nontrivial configuration changes that require
the long-term ioctl lock.

diffstat:

 sys/net/if_ethersubr.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 44429a23c36c -r ba7dee30cb5a sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c    Fri Dec 31 14:25:58 2021 +0000
+++ b/sys/net/if_ethersubr.c    Fri Dec 31 14:26:09 2021 +0000
@@ -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 @@
        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:
                /*



Home | Main Index | Thread Index | Old Index