Skip to content

Commit

Permalink
cfg80211: check for current_bss from giwrate
Browse files Browse the repository at this point in the history
When connecting to an ESSID manually, we may not set the BSSID, and thus
wdev->wext.connect.bssid will be NULL.
wdev->current_bss is always updated when a connection is established so we
should check it first.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Jul 10, 2009
1 parent e47a5cd commit 6c230c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/wireless/wext-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,11 @@ int cfg80211_wext_giwrate(struct net_device *dev,
if (!rdev->ops->get_station)
return -EOPNOTSUPP;

addr = wdev->wext.connect.bssid;
if (!addr)
if (wdev->current_bss)
addr = wdev->current_bss->pub.bssid;
else if (wdev->wext.connect.bssid)
addr = wdev->wext.connect.bssid;
else
return -EOPNOTSUPP;

err = rdev->ops->get_station(&rdev->wiphy, dev, addr, &sinfo);
Expand Down

0 comments on commit 6c230c0

Please sign in to comment.