diff options
author | Bill Moss <bmoss@clemson.edu> | 2007-10-10 16:23:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-10-16 21:32:37 -0400 |
commit | 107acb23ba763197d390ae9ffd347f3e2a524d39 (patch) | |
tree | 17a5d90f130fc19825549b3850f48a64c3f9298e /net | |
parent | cffdd30d20d163343b1c6de25bcb0cc978a1ebf9 (diff) |
[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: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6b4b0d5880db..a57fed77db27 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -511,32 +511,40 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, | |||
511 | 511 | ||
512 | static int ieee80211_ioctl_siwscan(struct net_device *dev, | 512 | static int ieee80211_ioctl_siwscan(struct net_device *dev, |
513 | struct iw_request_info *info, | 513 | struct iw_request_info *info, |
514 | struct iw_point *data, char *extra) | 514 | union iwreq_data *wrqu, char *extra) |
515 | { | 515 | { |
516 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 516 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
517 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 517 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
518 | struct iw_scan_req *req = NULL; | ||
518 | u8 *ssid = NULL; | 519 | u8 *ssid = NULL; |
519 | size_t ssid_len = 0; | 520 | size_t ssid_len = 0; |
520 | 521 | ||
521 | if (!netif_running(dev)) | 522 | if (!netif_running(dev)) |
522 | return -ENETDOWN; | 523 | return -ENETDOWN; |
523 | 524 | ||
524 | switch (sdata->type) { | 525 | if (wrqu->data.length == sizeof(struct iw_scan_req) && |
525 | case IEEE80211_IF_TYPE_STA: | 526 | wrqu->data.flags & IW_SCAN_THIS_ESSID) { |
526 | case IEEE80211_IF_TYPE_IBSS: | 527 | req = (struct iw_scan_req *)extra; |
527 | if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { | 528 | ssid = req->essid; |
528 | ssid = sdata->u.sta.ssid; | 529 | ssid_len = req->essid_len; |
529 | ssid_len = sdata->u.sta.ssid_len; | 530 | } else { |
530 | } | 531 | switch (sdata->type) { |
531 | break; | 532 | case IEEE80211_IF_TYPE_STA: |
532 | case IEEE80211_IF_TYPE_AP: | 533 | case IEEE80211_IF_TYPE_IBSS: |
533 | if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { | 534 | if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { |
534 | ssid = sdata->u.ap.ssid; | 535 | ssid = sdata->u.sta.ssid; |
535 | ssid_len = sdata->u.ap.ssid_len; | 536 | ssid_len = sdata->u.sta.ssid_len; |
537 | } | ||
538 | break; | ||
539 | case IEEE80211_IF_TYPE_AP: | ||
540 | if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { | ||
541 | ssid = sdata->u.ap.ssid; | ||
542 | ssid_len = sdata->u.ap.ssid_len; | ||
543 | } | ||
544 | break; | ||
545 | default: | ||
546 | return -EOPNOTSUPP; | ||
536 | } | 547 | } |
537 | break; | ||
538 | default: | ||
539 | return -EOPNOTSUPP; | ||
540 | } | 548 | } |
541 | 549 | ||
542 | return ieee80211_sta_req_scan(dev, ssid, ssid_len); | 550 | return ieee80211_sta_req_scan(dev, ssid, ssid_len); |