summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2019-01-12 16:11:22 +0000
committerstsp <stsp@openbsd.org>2019-01-12 16:11:22 +0000
commit1be8cfb24cf9617e1318a4e4865601c85ce188d0 (patch)
tree079ba1d1aa5d8d2f954b7bf72ccfa58e5e8da2e1
parentdelete <locale.h> (diff)
downloadwireguard-openbsd-1be8cfb24cf9617e1318a4e4865601c85ce188d0.tar.xz
wireguard-openbsd-1be8cfb24cf9617e1318a4e4865601c85ce188d0.zip
Make the scan loop in otus(4) terminate properly when the interface
is going down. Problem reported by ian@. ok mpi@ ian@
-rw-r--r--sys/dev/usb/if_otus.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c
index f3f9019bc49..86adec9cfce 100644
--- a/sys/dev/usb/if_otus.c
+++ b/sys/dev/usb/if_otus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_otus.c,v 1.60 2017/10/26 15:00:28 mpi Exp $ */
+/* $OpenBSD: if_otus.c,v 1.61 2019/01/12 16:11:22 stsp Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -691,13 +691,16 @@ void
otus_next_scan(void *arg)
{
struct otus_softc *sc = arg;
+ struct ieee80211com *ic = &sc->sc_ic;
+ struct ifnet *ifp = &ic->ic_if;
if (usbd_is_dying(sc->sc_udev))
return;
usbd_ref_incr(sc->sc_udev);
- if (sc->sc_ic.ic_state == IEEE80211_S_SCAN)
+ if (sc->sc_ic.ic_state == IEEE80211_S_SCAN &&
+ (ifp->if_flags & IFF_RUNNING))
ieee80211_next_scan(&sc->sc_ic.ic_if);
usbd_ref_decr(sc->sc_udev);