Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c230c02 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by John W. Linville
Browse files

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: default avatarSamuel Ortiz <samuel.ortiz@intel.com>
Acked-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e47a5cdd
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1136,8 +1136,11 @@ int cfg80211_wext_giwrate(struct net_device *dev,
	if (!rdev->ops->get_station)
		return -EOPNOTSUPP;

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

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