mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[MAC80211]: only honor IW_SCAN_THIS_ESSID in STA, IBSS, and AP modes
The previous IW_SCAN_THIS_ESSID patch left a hole allowing scan requests on interfaces in inappropriate modes. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fe537c0ee8
commit
d114f399b4
1 changed files with 19 additions and 18 deletions
|
@ -522,12 +522,6 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
|
||||||
if (!netif_running(dev))
|
if (!netif_running(dev))
|
||||||
return -ENETDOWN;
|
return -ENETDOWN;
|
||||||
|
|
||||||
if (wrqu->data.length == sizeof(struct iw_scan_req) &&
|
|
||||||
wrqu->data.flags & IW_SCAN_THIS_ESSID) {
|
|
||||||
req = (struct iw_scan_req *)extra;
|
|
||||||
ssid = req->essid;
|
|
||||||
ssid_len = req->essid_len;
|
|
||||||
} else {
|
|
||||||
switch (sdata->type) {
|
switch (sdata->type) {
|
||||||
case IEEE80211_IF_TYPE_STA:
|
case IEEE80211_IF_TYPE_STA:
|
||||||
case IEEE80211_IF_TYPE_IBSS:
|
case IEEE80211_IF_TYPE_IBSS:
|
||||||
|
@ -545,6 +539,13 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
|
||||||
default:
|
default:
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if SSID was specified explicitly then use that */
|
||||||
|
if (wrqu->data.length == sizeof(struct iw_scan_req) &&
|
||||||
|
wrqu->data.flags & IW_SCAN_THIS_ESSID) {
|
||||||
|
req = (struct iw_scan_req *)extra;
|
||||||
|
ssid = req->essid;
|
||||||
|
ssid_len = req->essid_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ieee80211_sta_req_scan(dev, ssid, ssid_len);
|
return ieee80211_sta_req_scan(dev, ssid, ssid_len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue