From 375c1a7d0d4cc1f5e3cdab23d866d91cf5c208f7 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 4 Jan 2005 19:53:38 +0000 Subject: - make sure int is in running state before touching the multicast filter - remove song and dance with IFF_UP, based on NetBSD commit to mc(4) ok martin@ --- sys/arch/mac68k/dev/if_sn.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/mac68k/dev/if_sn.c b/sys/arch/mac68k/dev/if_sn.c index fac81bbba87..41ed5e3c7ee 100644 --- a/sys/arch/mac68k/dev/if_sn.c +++ b/sys/arch/mac68k/dev/if_sn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sn.c,v 1.34 2004/11/26 21:21:24 miod Exp $ */ +/* $OpenBSD: if_sn.c,v 1.35 2005/01/04 19:53:37 brad Exp $ */ /* $NetBSD: if_sn.c,v 1.13 1997/04/25 03:40:10 briggs Exp $ */ /* @@ -270,7 +270,6 @@ snioctl(ifp, cmd, data) struct ifreq *ifr; struct sn_softc *sc = ifp->if_softc; int s = splnet(), err = 0; - int temp; switch (cmd) { @@ -311,9 +310,7 @@ snioctl(ifp, cmd, data) * reset the interface to pick up any other changes * in flags */ - temp = ifp->if_flags & IFF_UP; snreset(sc); - ifp->if_flags |= temp; snstart(ifp); } break; @@ -331,9 +328,8 @@ snioctl(ifp, cmd, data) * Multicast list has changed; set the hardware * filter accordingly. But remember UP flag! */ - temp = ifp->if_flags & IFF_UP; - snreset(sc); - ifp->if_flags |= temp; + if (ifp->if_flags & IFF_RUNNING) + snreset(sc); err = 0; } break; @@ -510,7 +506,7 @@ snstop(sc) } sc->sc_if.if_timer = 0; - sc->sc_if.if_flags &= ~(IFF_RUNNING | IFF_UP); + sc->sc_if.if_flags &= ~IFF_RUNNING; splx(s); return (0); @@ -527,7 +523,6 @@ snwatchdog(ifp) { struct sn_softc *sc = ifp->if_softc; struct mtd *mtd; - int temp; if (sc->mtd_hw != sc->mtd_free) { /* something still pending for transmit */ @@ -538,9 +533,7 @@ snwatchdog(ifp) else log(LOG_ERR, "%s: Tx - lost interrupt\n", sc->sc_dev.dv_xname); - temp = ifp->if_flags & IFF_UP; snreset(sc); - ifp->if_flags |= temp; } } -- cgit v1.2.3