ethersubr(9): Assert IFNET_LOCKED in ether_ioctl_reinit.

Changes to if_flags are nontrivial configuration changes that require
the long-term ioctl lock.
This commit is contained in:
riastradh 2021-12-31 14:26:09 +00:00
parent c046e1a457
commit 0802103d64
1 changed files with 4 additions and 2 deletions

View File

@ -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:
/*