summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authoravatar <avatar@FreeBSD.org>2005-08-30 14:27:47 +0000
committeravatar <avatar@FreeBSD.org>2005-08-30 14:27:47 +0000
commitc2fb68f116ec51c0a026b6ddcc9adfd8fff9f3b9 (patch)
tree71e5d7c91b74c4729dbaa4856685c6ac96d12b3e /sys/net80211
parentbe4e3433fd424120438710f9deaca1549f52ccf1 (diff)
downloadFreeBSD-src-c2fb68f116ec51c0a026b6ddcc9adfd8fff9f3b9.zip
FreeBSD-src-c2fb68f116ec51c0a026b6ddcc9adfd8fff9f3b9.tar.gz
Properly set ic_curchan before calling back to device driver to do channel
switching(ifconfig devX channel Y). This fix should make channel changing works again in monitor mode. Submitted by: sam X-MFC-With: other ic_curchan changes
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_ioctl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 9d5a285..00f8a76 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -2090,8 +2090,18 @@ ieee80211_ioctl_set80211(struct ieee80211com *ic, u_long cmd, struct ieee80211re
error = ENETRESET;
break;
}
- if (error == ENETRESET && ic->ic_opmode == IEEE80211_M_MONITOR)
- error = IS_UP(ic) ? ic->ic_reset(ic->ic_ifp) : 0;
+ if (error == ENETRESET &&
+ ic->ic_opmode == IEEE80211_M_MONITOR) {
+ if (IS_UP(ic)) {
+ /*
+ * Monitor mode can switch directly.
+ */
+ if (ic->ic_des_chan != IEEE80211_CHAN_ANYC)
+ ic->ic_curchan = ic->ic_des_chan;
+ error = ic->ic_reset(ic->ic_ifp);
+ } else
+ error = 0;
+ }
break;
case IEEE80211_IOC_POWERSAVE:
switch (ireq->i_val) {
OpenPOWER on IntegriCloud