Skip to content

Commit

Permalink
cfg80211: wext: don't display BSSID unless associated
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Sep 28, 2009
1 parent d1f8297 commit 33de4f9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/wireless/wext-sme.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
data->flags = 1;
data->length = wdev->wext.connect.ssid_len;
memcpy(ssid, wdev->wext.connect.ssid, data->length);
} else
data->flags = 0;
}
wdev_unlock(wdev);

return 0;
Expand Down Expand Up @@ -306,8 +305,6 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev,
wdev_lock(wdev);
if (wdev->current_bss)
memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN);
else if (wdev->wext.connect.bssid)
memcpy(ap_addr->sa_data, wdev->wext.connect.bssid, ETH_ALEN);
else
memset(ap_addr->sa_data, 0, ETH_ALEN);
wdev_unlock(wdev);
Expand Down

0 comments on commit 33de4f9

Please sign in to comment.