diff options
author | 2017-03-08 12:02:41 +0000 | |
---|---|---|
committer | 2017-03-08 12:02:41 +0000 | |
commit | 47a8efaf356cbc414ae4bf15dd18c823d87baa62 (patch) | |
tree | fa9c2045e5b09b401006ba910847043faf0f7c59 | |
parent | Enable msk(4). (diff) | |
download | wireguard-openbsd-47a8efaf356cbc414ae4bf15dd18c823d87baa62.tar.xz wireguard-openbsd-47a8efaf356cbc414ae4bf15dd18c823d87baa62.zip |
Do not clear IFF_UP, even in the error path, clearing IFF_RUNNING
is enough.
This flag should only be set by the stack, drivers shouldn't mess
with it.
Discussed with dlg@ and mikeb@, ok mikeb@, stsp@
-rw-r--r-- | sys/arch/macppc/dev/if_bm.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/ar5008.c | 3 | ||||
-rw-r--r-- | sys/dev/ic/ar9003.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/if_de.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_ipw.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_iwm.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_iwn.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 4 |
9 files changed, 11 insertions, 26 deletions
diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c index 4cb561f38dd..348d97400cc 100644 --- a/sys/arch/macppc/dev/if_bm.c +++ b/sys/arch/macppc/dev/if_bm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bm.c,v 1.41 2017/01/22 10:17:37 dlg Exp $ */ +/* $OpenBSD: if_bm.c,v 1.42 2017/03/08 12:02:41 mpi Exp $ */ /* $NetBSD: if_bm.c,v 1.1 1999/01/01 01:27:52 tsubai Exp $ */ /*- @@ -595,7 +595,7 @@ bmac_stop(struct bmac_softc *sc) dbdma_stop(sc->sc_txdma); dbdma_stop(sc->sc_rxdma); - ifp->if_flags &= ~(IFF_UP | IFF_RUNNING); + ifp->if_flags &= ~IFF_RUNNING; ifp->if_timer = 0; splx(s); diff --git a/sys/dev/ic/ar5008.c b/sys/dev/ic/ar5008.c index 7cfea5a114c..805f4e0de5f 100644 --- a/sys/dev/ic/ar5008.c +++ b/sys/dev/ic/ar5008.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5008.c,v 1.42 2017/02/01 12:45:56 stsp Exp $ */ +/* $OpenBSD: ar5008.c,v 1.43 2017/03/08 12:02:41 mpi Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -1273,7 +1273,6 @@ ar5008_intr(struct athn_softc *sc) printf("%s: radio switch turned off\n", sc->sc_dev.dv_xname); /* Turn the interface down. */ - ifp->if_flags &= ~IFF_UP; athn_stop(ifp, 1); return (1); } diff --git a/sys/dev/ic/ar9003.c b/sys/dev/ic/ar9003.c index 74338f88705..ace7fd5935d 100644 --- a/sys/dev/ic/ar9003.c +++ b/sys/dev/ic/ar9003.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar9003.c,v 1.44 2017/01/30 09:42:14 stsp Exp $ */ +/* $OpenBSD: ar9003.c,v 1.45 2017/03/08 12:02:41 mpi Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -1375,7 +1375,6 @@ ar9003_intr(struct athn_softc *sc) printf("%s: radio switch turned off\n", sc->sc_dev.dv_xname); /* Turn the interface down. */ - ifp->if_flags &= ~IFF_UP; athn_stop(ifp, 1); return (1); } diff --git a/sys/dev/pci/if_de.c b/sys/dev/pci/if_de.c index a02167197bf..47b6a3c9c1b 100644 --- a/sys/dev/pci/if_de.c +++ b/sys/dev/pci/if_de.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_de.c,v 1.136 2017/01/22 10:17:38 dlg Exp $ */ +/* $OpenBSD: if_de.c,v 1.137 2017/03/08 12:02:41 mpi Exp $ */ /* $NetBSD: if_de.c,v 1.58 1998/01/12 09:39:58 thorpej Exp $ */ /*- @@ -1281,7 +1281,7 @@ tulip_mii_autonegotiate(tulip_softc_t * const sc, const unsigned phyaddr) #endif sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE; sc->tulip_probe_state = TULIP_PROBE_FAILED; - sc->tulip_if.if_flags &= ~(IFF_UP|IFF_RUNNING); + sc->tulip_if.if_flags &= ~IFF_RUNNING; return; } status = tulip_mii_readreg(sc, phyaddr, PHYREG_STATUS) diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index a75f4600219..2ff08aef73b 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.119 2017/01/22 10:17:38 dlg Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.120 2017/03/08 12:02:41 mpi Exp $ */ /*- * Copyright (c) 2004-2008 @@ -809,7 +809,6 @@ ipw_newstate_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf) break; case IPW_STATE_RADIO_DISABLED: - ifp->if_flags &= ~IFF_UP; ipw_stop(&ic->ic_if, 1); break; } @@ -1047,7 +1046,6 @@ ipw_intr(void *arg) if (r & (IPW_INTR_FATAL_ERROR | IPW_INTR_PARITY_ERROR)) { printf("%s: fatal firmware error\n", sc->sc_dev.dv_xname); - ifp->if_flags &= ~IFF_UP; ipw_stop(ifp, 1); return 1; } @@ -1336,7 +1334,6 @@ ipw_watchdog(struct ifnet *ifp) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); - ifp->if_flags &= ~IFF_UP; ipw_stop(ifp, 1); ifp->if_oerrors++; return; diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index f68ec205e60..faa9e4246ad 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.134 2017/01/22 10:17:38 dlg Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.135 2017/03/08 12:02:41 mpi Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1164,7 +1164,6 @@ iwi_intr(void *arg) if (r & IWI_INTR_RADIO_OFF) { DPRINTF(("radio transmitter off\n")); - ifp->if_flags &= ~IFF_UP; iwi_stop(ifp, 1); return 1; } @@ -1429,7 +1428,6 @@ iwi_watchdog(struct ifnet *ifp) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); - ifp->if_flags &= ~IFF_UP; iwi_stop(ifp, 1); ifp->if_oerrors++; return; diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index f8acdfa23d5..947bd975481 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.165 2017/02/20 15:38:04 krw Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.166 2017/03/08 12:02:41 mpi Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -6151,8 +6151,6 @@ iwm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (ifp->if_flags & IFF_UP) { if (!(ifp->if_flags & IFF_RUNNING)) { err = iwm_init(ifp); - if (err) - ifp->if_flags &= ~IFF_UP; } } else { if (ifp->if_flags & IFF_RUNNING) @@ -6801,7 +6799,6 @@ iwm_intr(void *arg) if (r1 & IWM_CSR_INT_BIT_HW_ERR) { handled |= IWM_CSR_INT_BIT_HW_ERR; printf("%s: hardware error, stopping device \n", DEVNAME(sc)); - ifp->if_flags &= ~IFF_UP; iwm_stop(ifp, 1); rv = 1; goto out; @@ -6819,7 +6816,6 @@ iwm_intr(void *arg) if (r1 & IWM_CSR_INT_BIT_RF_KILL) { handled |= IWM_CSR_INT_BIT_RF_KILL; if (iwm_check_rfkill(sc) && (ifp->if_flags & IFF_UP)) { - ifp->if_flags &= ~IFF_UP; iwm_stop(ifp, 1); } } diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 06a074d5e26..6013d7486f1 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.184 2017/02/20 15:38:04 krw Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.185 2017/03/08 12:02:41 mpi Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -2556,7 +2556,6 @@ iwn_notif_intr(struct iwn_softc *sc) printf("%s: Radio transmitter is off\n", sc->sc_dev.dv_xname); /* Turn the interface down. */ - ifp->if_flags &= ~IFF_UP; iwn_stop(ifp, 1); return; /* No further processing. */ } @@ -3240,7 +3239,6 @@ iwn_watchdog(struct ifnet *ifp) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); - ifp->if_flags &= ~IFF_UP; iwn_stop(ifp, 1); ifp->if_oerrors++; return; diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index aecdc39e104..edc03dd0d76 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.138 2017/01/22 10:17:38 dlg Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.139 2017/03/08 12:02:41 mpi Exp $ */ /*- * Copyright (c) 2006-2008 @@ -1476,7 +1476,6 @@ wpi_notif_intr(struct wpi_softc *sc) printf("%s: Radio transmitter is off\n", sc->sc_dev.dv_xname); /* Turn the interface down. */ - ifp->if_flags &= ~IFF_UP; wpi_stop(ifp, 1); return; /* No further processing. */ } @@ -1954,7 +1953,6 @@ wpi_watchdog(struct ifnet *ifp) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); - ifp->if_flags &= ~IFF_UP; wpi_stop(ifp, 1); ifp->if_oerrors++; return; |