Search Linux Wireless

[PATCH] cfg80211: check for current_bss from giwrate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 net/wireless/wext-compat.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: iwm-2.6/net/wireless/wext-compat.c
===================================================================
--- iwm-2.6.orig/net/wireless/wext-compat.c	2009-07-03 01:40:09.000000000 +0200
+++ iwm-2.6/net/wireless/wext-compat.c	2009-07-03 01:40:18.000000000 +0200
@@ -1137,8 +1137,11 @@ int cfg80211_wext_giwrate(struct net_dev
 	if (!rdev->ops->get_station)
 		return -EOPNOTSUPP;
 
-	addr = wdev->wext.connect.bssid;
-	if (!addr)
+	if (wdev->current_bss)
+		addr = wdev->current_bss->bssid;
+	else if (wdev->wext.connect.bssid)
+		addr = wdev->wext.connect.bssid;
+	else
 		return -ENOTSUPP;
 
 	err = rdev->ops->get_station(&rdev->wiphy, dev, addr, &sinfo);
-- 
Intel Open Source Technology Centre
http://oss.intel.com/
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux