From patchwork Wed Aug 19 08:08:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yi X-Patchwork-Id: 42541 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7J86dLj023755 for ; Wed, 19 Aug 2009 08:06:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751724AbZHSIGg (ORCPT ); Wed, 19 Aug 2009 04:06:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751779AbZHSIGf (ORCPT ); Wed, 19 Aug 2009 04:06:35 -0400 Received: from mga14.intel.com ([143.182.124.37]:32201 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751697AbZHSIGe (ORCPT ); Wed, 19 Aug 2009 04:06:34 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 19 Aug 2009 01:06:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,407,1246863600"; d="scan'208";a="177592670" Received: from yzhu-mobl0.sh.intel.com (HELO localhost.localdomain) ([10.239.36.209]) by azsmga001.ch.intel.com with ESMTP; 19 Aug 2009 01:06:34 -0700 From: Zhu Yi To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Zhu Yi , Johannes Berg Subject: [PATCH V2] cfg80211: allow cfg80211_connect_result with bssid == NULL Date: Wed, 19 Aug 2009 16:08:22 +0800 Message-Id: <1250669302-11362-1-git-send-email-yi.zhu@intel.com> X-Mailer: git-send-email 1.6.0.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In case of connection failure, the bssid info is not a must have. Cc: Johannes Berg Signed-off-by: Zhu Yi Acked-by: Johannes Berg --- V2: change a __cfg80211_connect_result() caller to used NULL instead of zero addr net/wireless/core.c | 4 +++- net/wireless/sme.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/wireless/core.c b/net/wireless/core.c index e630648..8eddf98 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -309,7 +310,8 @@ static void cfg80211_process_events(struct wireless_dev *wdev) switch (ev->type) { case EVENT_CONNECT_RESULT: __cfg80211_connect_result( - wdev->netdev, ev->cr.bssid, + wdev->netdev, is_zero_ether_addr(ev->cr.bssid) ? + NULL : ev->cr.bssid, ev->cr.req_ie, ev->cr.req_ie_len, ev->cr.resp_ie, ev->cr.resp_ie_len, ev->cr.status, diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 8e2ef54..dbd8211 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -458,7 +458,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);