diff options
author | Samuel Ortiz <samuel.ortiz@intel.com> | 2009-07-02 20:00:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:02:27 -0400 |
commit | 6c230c02700f9d2aebe6edf9f571835c06707940 (patch) | |
tree | 5cfdd046376e74d32d4c32be1c1ef12ba57dce86 /net/wireless/wext-compat.c | |
parent | e47a5cddf893815e7da16e3226b959af785d8aaf (diff) |
cfg80211: check for current_bss from giwrate
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>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index d39688ca7fe5..2c33cd83cfe9 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -1136,8 +1136,11 @@ int cfg80211_wext_giwrate(struct net_device *dev, | |||
1136 | if (!rdev->ops->get_station) | 1136 | if (!rdev->ops->get_station) |
1137 | return -EOPNOTSUPP; | 1137 | return -EOPNOTSUPP; |
1138 | 1138 | ||
1139 | addr = wdev->wext.connect.bssid; | 1139 | if (wdev->current_bss) |
1140 | if (!addr) | 1140 | addr = wdev->current_bss->pub.bssid; |
1141 | else if (wdev->wext.connect.bssid) | ||
1142 | addr = wdev->wext.connect.bssid; | ||
1143 | else | ||
1141 | return -EOPNOTSUPP; | 1144 | return -EOPNOTSUPP; |
1142 | 1145 | ||
1143 | err = rdev->ops->get_station(&rdev->wiphy, dev, addr, &sinfo); | 1146 | err = rdev->ops->get_station(&rdev->wiphy, dev, addr, &sinfo); |