diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2019-05-28 07:41:46 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2019-05-28 07:41:46 +0000 |
| commit | f515fb39dacd0abce2aa9df99560ed9bab4f077b (patch) | |
| tree | 3724853fb259cb8c671627600852df468717a3bb /sys/dev/bi | |
| parent | 9cc62795521ef562d9fd83186cdd52e5cc6996a2 (diff) | |
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
Diffstat (limited to 'sys/dev/bi')
| -rw-r--r-- | sys/dev/bi/if_ni.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/bi/if_ni.c b/sys/dev/bi/if_ni.c index 06a062616ae..c4cfcf20153 100644 --- a/sys/dev/bi/if_ni.c +++ b/sys/dev/bi/if_ni.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ni.c,v 1.48 2019/05/23 13:10:51 msaitoh Exp $ */ +/* $NetBSD: if_ni.c,v 1.49 2019/05/28 07:41:48 msaitoh Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.48 2019/05/23 13:10:51 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.49 2019/05/28 07:41:48 msaitoh Exp $"); #include "opt_inet.h" @@ -795,6 +795,7 @@ ni_add_rxbuf(struct ni_softc *sc, struct ni_dg *data, int idx) void ni_setup(struct ni_softc *sc) { + struct ethercom *ec = &sc->sc_ec; struct ifnet *ifp = &sc->sc_if; struct ni_msg *msg; struct ni_ptdb *ptdb; @@ -824,7 +825,8 @@ ni_setup(struct ni_softc *sc) msg->nm_len += 8; ifp->if_flags &= ~IFF_ALLMULTI; if ((ifp->if_flags & IFF_PROMISC) == 0) { - ETHER_FIRST_MULTI(step, &sc->sc_ec, enm); + ETHER_LOCK(ec); + ETHER_FIRST_MULTI(step, ec, enm); i = 1; while (enm != NULL) { if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6)) { @@ -838,6 +840,7 @@ ni_setup(struct ni_softc *sc) ETHER_ADDR_LEN); ETHER_NEXT_MULTI(step, enm); } + ETHER_UNLOCK(ec); } } else msg->nm_opcode2 = NI_CLPTDB; |
