summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_rum.c
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2006-12-03 16:39:13 +0000
committerdamien <damien@openbsd.org>2006-12-03 16:39:13 +0000
commited3bbfa7d562e104b5598ba989aa16d6820c2d32 (patch)
tree90f9167ea9d06248738406f3a0b41ea007b9f6f5 /sys/dev/usb/if_rum.c
parentClean frame buffer attachment code: (diff)
downloadwireguard-openbsd-ed3bbfa7d562e104b5598ba989aa16d6820c2d32.tar.xz
wireguard-openbsd-ed3bbfa7d562e104b5598ba989aa16d6820c2d32.zip
fix handling of the SIOCS80211CHANNEL ioctl in monitor mode:
don't call xxx_set_chan() if the interface is not up&running. patch from Steffen Schuetz (st dot sch at gmx dot net) with minor modifications by me. closes kernel/5313
Diffstat (limited to 'sys/dev/usb/if_rum.c')
-rw-r--r--sys/dev/usb/if_rum.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c
index 58472d16067..00e6e30e32e 100644
--- a/sys/dev/usb/if_rum.c
+++ b/sys/dev/usb/if_rum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rum.c,v 1.46 2006/12/03 16:16:58 damien Exp $ */
+/* $OpenBSD: if_rum.c,v 1.47 2006/12/03 16:39:13 damien Exp $ */
/*-
* Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr>
@@ -343,7 +343,8 @@ USB_ATTACH(rum)
if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) {
/* set supported .11a rates */
- ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a;
+ ic->ic_sup_rates[IEEE80211_MODE_11A] =
+ ieee80211_std_rateset_11a;
/* set supported .11a channels */
for (i = 34; i <= 46; i += 4) {
@@ -1349,7 +1350,9 @@ rum_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ieee80211_ioctl(ifp, cmd, data);
if (error == ENETRESET &&
ic->ic_opmode == IEEE80211_M_MONITOR) {
- rum_set_chan(sc, ic->ic_ibss_chan);
+ if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
+ (IFF_UP | IFF_RUNNING))
+ rum_set_chan(sc, ic->ic_ibss_chan);
error = 0;
}
break;