aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-sme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-09-17 11:35:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-09-28 16:55:04 -0400
commit33de4f9d787e01646f715ac10c2699fb98fd479e (patch)
tree8d9e9e42ac8143b7d7d26c46fd12aff091c10d74 /net/wireless/wext-sme.c
parentd1f8297a96b0d70f17704296a6666468f2087ce6 (diff)
cfg80211: wext: don't display BSSID unless associated
Currently, cfg80211's SIOCGIWAP implementation returns the BSSID that the user set, even if the connection has since been dropped due to other changes. It only should return the current BSSID when actually connected. Also do a small code cleanup. Reported-by: Thomas H. Guenther <thomas.h.guenther@intel.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Tested-by: Thomas H. Guenther <thomas.h.guenther@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/wext-sme.c')
-rw-r--r--net/wireless/wext-sme.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index bf725275eb8d..53c6ba98dc25 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -229,8 +229,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
229 data->flags = 1; 229 data->flags = 1;
230 data->length = wdev->wext.connect.ssid_len; 230 data->length = wdev->wext.connect.ssid_len;
231 memcpy(ssid, wdev->wext.connect.ssid, data->length); 231 memcpy(ssid, wdev->wext.connect.ssid, data->length);
232 } else 232 }
233 data->flags = 0;
234 wdev_unlock(wdev); 233 wdev_unlock(wdev);
235 234
236 return 0; 235 return 0;
@@ -306,8 +305,6 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev,
306 wdev_lock(wdev); 305 wdev_lock(wdev);
307 if (wdev->current_bss) 306 if (wdev->current_bss)
308 memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN); 307 memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN);
309 else if (wdev->wext.connect.bssid)
310 memcpy(ap_addr->sa_data, wdev->wext.connect.bssid, ETH_ALEN);
311 else 308 else
312 memset(ap_addr->sa_data, 0, ETH_ALEN); 309 memset(ap_addr->sa_data, 0, ETH_ALEN);
313 wdev_unlock(wdev); 310 wdev_unlock(wdev);