diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2013-01-29 07:17:46 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2013-01-29 07:17:46 +0000 |
commit | 9441acdfb0f54a3136510f0392b5d01d727114af (patch) | |
tree | d0fbaf0f7700095eb24909a9acaf898f4ea81855 /sys/dev | |
parent | edc5139d3286f1fb35bc54280becbffa05eef0a5 (diff) |
- Set ENETRESET within myx_ioctl() instead of calling myx_iff() directly, to be
consistent with other drivers.
- Clear IFF_ALLMULTI flag early and at the top of myx_iff().
- Set IFF_ALLMULTI when in promisc mode.
ok dlg@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_myx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 68d400ac11b..7e27b3de8c5 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.41 2013/01/25 02:56:41 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.42 2013/01/29 07:17:45 brad Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -878,7 +878,7 @@ myx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: if (ISSET(ifp->if_flags, IFF_UP)) { if (ISSET(ifp->if_flags, IFF_RUNNING)) - myx_iff(sc); + error = ENETRESET; else myx_up(sc); } else { @@ -1236,14 +1236,14 @@ myx_iff(struct myx_softc *sc) struct ether_multi *enm; struct ether_multistep step; + CLR(ifp->if_flags, IFF_ALLMULTI); + if (myx_cmd(sc, ISSET(ifp->if_flags, IFF_PROMISC) ? MYXCMD_SET_PROMISC : MYXCMD_UNSET_PROMISC, &mc, NULL) != 0) { printf("%s: failed to configure promisc mode\n", DEVNAME(sc)); return; } - CLR(ifp->if_flags, IFF_ALLMULTI); - if (myx_cmd(sc, MYXCMD_SET_ALLMULTI, &mc, NULL) != 0) { printf("%s: failed to enable ALLMULTI\n", DEVNAME(sc)); return; @@ -1254,7 +1254,7 @@ myx_iff(struct myx_softc *sc) return; } - if (sc->sc_ac.ac_multirangecnt > 0) { + if (ISSET(ifp->if_flags, IFF_PROMISC) || sc->sc_ac.ac_multirangecnt > 0) { SET(ifp->if_flags, IFF_ALLMULTI); return; } |