From patchwork Wed Nov 13 16:37:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 290992 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 3AE6A2C0084 for ; Thu, 14 Nov 2013 03:38:45 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 84E559C14F; Wed, 13 Nov 2013 11:38:28 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SWWKw2Pc41Is; Wed, 13 Nov 2013 11:38:28 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 0D42E9C150; Wed, 13 Nov 2013 11:37:51 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 3ABE49C148 for ; Wed, 13 Nov 2013 11:37:49 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cWnacNYfcXsl for ; Wed, 13 Nov 2013 11:37:43 -0500 (EST) Received: from s3.neomailbox.net (s3.neomailbox.net [178.209.62.157]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "neomailbox.net", Issuer "Alpha CA" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id B1A699C0E9 for ; Wed, 13 Nov 2013 11:37:39 -0500 (EST) From: Antonio Quartulli To: hostap Subject: [PATCHv2 2/3] Register for AUTH frames when joining an IBSS network Date: Wed, 13 Nov 2013 17:37:12 +0100 Message-Id: <1384360633-568-3-git-send-email-antonio@meshcoding.com> In-Reply-To: <1384360633-568-1-git-send-email-antonio@meshcoding.com> References: <1384360633-568-1-git-send-email-antonio@meshcoding.com> Cc: Antonio Quartulli X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Antonio Quartulli In order to correctly handle IBSS/RSN, wpa_s has to register for any incoming AUTH message so to properly react when those are received. Signed-hostap: Nicolas Cavallari Signed-hostap: Antonio Quartulli --- src/drivers/driver_nl80211.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 728eaa8..a58b444 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -310,6 +310,9 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss, unsigned int freq, unsigned int wait, const u8 *buf, size_t buf_len, u64 *cookie, int no_cck, int no_ack, int offchanok); +static int nl80211_register_frame(struct i802_bss *bss, + struct nl_handle *hl_handle, + u16 type, const u8 *match, size_t match_len); static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss, int report); #ifdef ANDROID @@ -1814,12 +1817,19 @@ static void mlme_event_michael_mic_failure(struct i802_bss *bss, static void mlme_event_join_ibss(struct wpa_driver_nl80211_data *drv, struct nlattr *tb[]) { + u16 type = (WLAN_FC_TYPE_MGMT << 2) | (WLAN_FC_STYPE_AUTH << 4); + if (tb[NL80211_ATTR_MAC] == NULL) { wpa_printf(MSG_DEBUG, "nl80211: No address in IBSS joined " "event"); return; } os_memcpy(drv->bssid, nla_data(tb[NL80211_ATTR_MAC]), ETH_ALEN); + + /* register for any AUTH message */ + nl80211_register_frame(&drv->first_bss, drv->first_bss.nl_mgmt, + type, NULL, 0); + drv->associated = 1; wpa_printf(MSG_DEBUG, "nl80211: IBSS " MACSTR " joined", MAC2STR(drv->bssid));