提交 33de4f9d 编写于 作者: J Johannes Berg 提交者: John W. Linville

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: NThomas H. Guenther <thomas.h.guenther@intel.com>
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Tested-by: NThomas H. Guenther <thomas.h.guenther@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 d1f8297a
...@@ -229,8 +229,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev, ...@@ -229,8 +229,7 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
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);
} else }
data->flags = 0;
wdev_unlock(wdev); wdev_unlock(wdev);
return 0; return 0;
...@@ -306,8 +305,6 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev, ...@@ -306,8 +305,6 @@ int cfg80211_mgd_wext_giwap(struct net_device *dev,
wdev_lock(wdev); wdev_lock(wdev);
if (wdev->current_bss) if (wdev->current_bss)
memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN); 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 else
memset(ap_addr->sa_data, 0, ETH_ALEN); memset(ap_addr->sa_data, 0, ETH_ALEN);
wdev_unlock(wdev); wdev_unlock(wdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册