wireless: display wext SSID when connected by cfg80211
authorZhu Yi <yi.zhu@intel.com>
Wed, 5 Aug 2009 07:07:13 +0000 (15:07 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 14 Aug 2009 13:12:41 +0000 (09:12 -0400)
cfg80211 displays correct link info when connected by wext. But if
the connection is setup by cfg80211, wext cannot display the SSID.
This patch fixed this issue.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/wext-sme.c

index 7bacbd1c2af6a2fcc3ab0a0cef242f054f399d91..e4a054aceb5a803400dc9218fd301f4885eff8a9 100644 (file)
@@ -206,7 +206,15 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
        data->flags = 0;
 
        wdev_lock(wdev);
-       if (wdev->wext.connect.ssid && wdev->wext.connect.ssid_len) {
+       if (wdev->current_bss) {
+               const u8 *ie = ieee80211_bss_get_ie(&wdev->current_bss->pub,
+                                                   WLAN_EID_SSID);
+               if (ie) {
+                       data->flags = 1;
+                       data->length = ie[1];
+                       memcpy(ssid, ie + 2, data->length);
+               }
+       } else if (wdev->wext.connect.ssid && wdev->wext.connect.ssid_len) {
                data->flags = 1;
                data->length = wdev->wext.connect.ssid_len;
                memcpy(ssid, wdev->wext.connect.ssid, data->length);