diff options
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 5d0176338539..aa80c0c4efd4 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -1209,7 +1209,7 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) | |||
1209 | /* we are under RTNL - globally locked - so can use static structs */ | 1209 | /* we are under RTNL - globally locked - so can use static structs */ |
1210 | static struct iw_statistics wstats; | 1210 | static struct iw_statistics wstats; |
1211 | static struct station_info sinfo; | 1211 | static struct station_info sinfo; |
1212 | u8 *addr; | 1212 | u8 bssid[ETH_ALEN]; |
1213 | 1213 | ||
1214 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) | 1214 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION) |
1215 | return NULL; | 1215 | return NULL; |
@@ -1217,11 +1217,16 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) | |||
1217 | if (!rdev->ops->get_station) | 1217 | if (!rdev->ops->get_station) |
1218 | return NULL; | 1218 | return NULL; |
1219 | 1219 | ||
1220 | addr = wdev->wext.connect.bssid; | 1220 | /* Grab BSSID of current BSS, if any */ |
1221 | if (!addr) | 1221 | wdev_lock(wdev); |
1222 | if (!wdev->current_bss) { | ||
1223 | wdev_unlock(wdev); | ||
1222 | return NULL; | 1224 | return NULL; |
1225 | } | ||
1226 | memcpy(bssid, wdev->current_bss->pub.bssid, ETH_ALEN); | ||
1227 | wdev_unlock(wdev); | ||
1223 | 1228 | ||
1224 | if (rdev->ops->get_station(&rdev->wiphy, dev, addr, &sinfo)) | 1229 | if (rdev->ops->get_station(&rdev->wiphy, dev, bssid, &sinfo)) |
1225 | return NULL; | 1230 | return NULL; |
1226 | 1231 | ||
1227 | memset(&wstats, 0, sizeof(wstats)); | 1232 | memset(&wstats, 0, sizeof(wstats)); |