Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d114f399 authored by John W. Linville's avatar John W. Linville Committed by David S. Miller
Browse files

[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: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe537c0e
Loading
Loading
Loading
Loading
+19 −18
Original line number Diff line number Diff line
@@ -522,12 +522,6 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
	if (!netif_running(dev))
		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) {
	case IEEE80211_IF_TYPE_STA:
	case IEEE80211_IF_TYPE_IBSS:
@@ -545,6 +539,13 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
	default:
		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);