Commit 908d4369 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

cfg80211: don't look at wdev->ssid for giwessid

This variable is only used internally, _while_ connected.
If we use it, the sequence

# iwconfig wlan1 essid foo
<connects>
# iwconfig wlan1 essid ""
<disconnects>
# iwconfig

will still display "foo" as the SSID afterwards, which
is obviously quite bogus. Fix this by only displaying
the wext SSID, if present.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4b14c96d
...@@ -209,11 +209,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev, ...@@ -209,11 +209,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
data->flags = 0; data->flags = 0;
wdev_lock(wdev); wdev_lock(wdev);
if (wdev->ssid_len) { if (wdev->wext.connect.ssid && wdev->wext.connect.ssid_len) {
data->flags = 1;
data->length = wdev->ssid_len;
memcpy(ssid, wdev->ssid, data->length);
} else if (wdev->wext.connect.ssid && wdev->wext.connect.ssid_len) {
data->flags = 1; data->flags = 1;
data->length = wdev->wext.connect.ssid_len; data->length = wdev->wext.connect.ssid_len;
memcpy(ssid, wdev->wext.connect.ssid, data->length); memcpy(ssid, wdev->wext.connect.ssid, data->length);
......
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