diff mbox

cfg80211: allow cfg80211_connect_result with bssid == NULL

Message ID 1250663378-9113-1-git-send-email-yi.zhu@intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Zhu Yi Aug. 19, 2009, 6:29 a.m. UTC
In case of connection failure, the bssid info is not a must have.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 net/wireless/sme.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Johannes Berg Aug. 19, 2009, 7:30 a.m. UTC | #1
On Wed, 2009-08-19 at 14:29 +0800, Zhu Yi wrote:
> In case of connection failure, the bssid info is not a must have.

Good point, thanks. In fact, the original __cfg80211_connect_result()
did handle a NULL bssid, but the event stuff lost it. I think you should
also pass NULL in core.c when is_zero_ether_addr()?

johannes
diff mbox

Patch

diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index b78a111..bc9584a 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -435,7 +435,8 @@  void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
 		return;
 
 	ev->type = EVENT_CONNECT_RESULT;
-	memcpy(ev->cr.bssid, bssid, ETH_ALEN);
+	if (bssid)
+		memcpy(ev->cr.bssid, bssid, ETH_ALEN);
 	ev->cr.req_ie = ((u8 *)ev) + sizeof(*ev);
 	ev->cr.req_ie_len = req_ie_len;
 	memcpy((void *)ev->cr.req_ie, req_ie, req_ie_len);