aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2007-07-27 09:43:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-08-06 15:39:15 -0400
commitf27b62d3e7ecca42a75f1c5d3cc225539301ba6d (patch)
tree0b12e8c0b11c0f77ea1bff3e11b6cc4dc7a7f7b7 /net
parentba9b07d08b7e512535c6fcfcc2cf470f3dd58b8d (diff)
[PATCH] mac80211: don't allow scanning in monitor mode
zd1211rw gets confused when the user asks for a scan when the device is in monitor mode. This patch tightens up the SIWSCAN handler to deny the scan under these conditions. Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_ioctl.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index d0e1ab5589db..e7904db55325 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -697,17 +697,24 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
697 if (!netif_running(dev)) 697 if (!netif_running(dev))
698 return -ENETDOWN; 698 return -ENETDOWN;
699 699
700 if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { 700 switch (sdata->type) {
701 if (sdata->type == IEEE80211_IF_TYPE_STA || 701 case IEEE80211_IF_TYPE_STA:
702 sdata->type == IEEE80211_IF_TYPE_IBSS) { 702 case IEEE80211_IF_TYPE_IBSS:
703 if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
703 ssid = sdata->u.sta.ssid; 704 ssid = sdata->u.sta.ssid;
704 ssid_len = sdata->u.sta.ssid_len; 705 ssid_len = sdata->u.sta.ssid_len;
705 } else if (sdata->type == IEEE80211_IF_TYPE_AP) { 706 }
707 break;
708 case IEEE80211_IF_TYPE_AP:
709 if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
706 ssid = sdata->u.ap.ssid; 710 ssid = sdata->u.ap.ssid;
707 ssid_len = sdata->u.ap.ssid_len; 711 ssid_len = sdata->u.ap.ssid_len;
708 } else 712 }
709 return -EINVAL; 713 break;
714 default:
715 return -EOPNOTSUPP;
710 } 716 }
717
711 return ieee80211_sta_req_scan(dev, ssid, ssid_len); 718 return ieee80211_sta_req_scan(dev, ssid, ssid_len);
712} 719}
713 720