From: Johannes Berg Date: Fri, 10 Jul 2009 15:53:34 +0000 (+0200) Subject: cfg80211: don't look at wdev->ssid for giwessid X-Git-Tag: firefly_0821_release~12983^2~544^2~103 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=908d4369a394e816767d566d9c3d15a5af8c1c55;p=firefly-linux-kernel-4.4.55.git 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 # iwconfig wlan1 essid "" # 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: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c index c33ea9a5de78..cd5764fd001a 100644 --- a/net/wireless/wext-sme.c +++ b/net/wireless/wext-sme.c @@ -209,11 +209,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev, data->flags = 0; wdev_lock(wdev); - if (wdev->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) { + 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);