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>
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);