Skip to content

Commit

Permalink
[PATCH] mac80211: don't allow scanning in monitor mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jiri Benc <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
Daniel Drake authored and linvjw committed Aug 6, 2007
1 parent ba9b07d commit f27b62d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions net/mac80211/ieee80211_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,17 +697,24 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
if (!netif_running(dev))
return -ENETDOWN;

if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
if (sdata->type == IEEE80211_IF_TYPE_STA ||
sdata->type == IEEE80211_IF_TYPE_IBSS) {
switch (sdata->type) {
case IEEE80211_IF_TYPE_STA:
case IEEE80211_IF_TYPE_IBSS:
if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
ssid = sdata->u.sta.ssid;
ssid_len = sdata->u.sta.ssid_len;
} else if (sdata->type == IEEE80211_IF_TYPE_AP) {
}
break;
case IEEE80211_IF_TYPE_AP:
if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
ssid = sdata->u.ap.ssid;
ssid_len = sdata->u.ap.ssid_len;
} else
return -EINVAL;
}
break;
default:
return -EOPNOTSUPP;
}

return ieee80211_sta_req_scan(dev, ssid, ssid_len);
}

Expand Down

0 comments on commit f27b62d

Please sign in to comment.