Skip to content

Commit

Permalink
cfg80211: don't look at wdev->ssid for giwessid
Browse files Browse the repository at this point in the history
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: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jul 24, 2009
1 parent 4b14c96 commit 908d436
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions net/wireless/wext-sme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 908d436

Please sign in to comment.