From: Samuel Ortiz Date: Fri, 3 Jul 2009 00:00:48 +0000 (+0200) Subject: cfg80211: check for current_bss from giwrate X-Git-Tag: v2.6.32-rc1~703^2~665 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c230c02700f9d2aebe6edf9f571835c06707940;p=platform%2Fkernel%2Flinux-exynos.git 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 Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index d39688c..2c33cd8 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, 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);