Commit 107acb23 authored by Bill Moss's avatar Bill Moss Committed by John W. Linville

[PATCH] mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl

This patch fixes the problem of associating with wpa_secured hidden
AP.  Please try out.

The original author of this patch is Bill Moss <bmoss@clemson.edu>
Signed-off-by: default avatarAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent cffdd30d
...@@ -511,16 +511,23 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, ...@@ -511,16 +511,23 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
static int ieee80211_ioctl_siwscan(struct net_device *dev, static int ieee80211_ioctl_siwscan(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
struct iw_point *data, char *extra) union iwreq_data *wrqu, char *extra)
{ {
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct iw_scan_req *req = NULL;
u8 *ssid = NULL; u8 *ssid = NULL;
size_t ssid_len = 0; size_t ssid_len = 0;
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:
...@@ -538,6 +545,7 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev, ...@@ -538,6 +545,7 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
}
return ieee80211_sta_req_scan(dev, ssid, ssid_len); return ieee80211_sta_req_scan(dev, ssid, ssid_len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment