From patchwork Wed Jun 19 20:11:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 252650 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 C2BA32C0079 for ; Thu, 20 Jun 2013 06:14:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2F6099C140; Wed, 19 Jun 2013 16:14:13 -0400 (EDT) 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 jXeVSyY7IqDJ; Wed, 19 Jun 2013 16:14:12 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DCE399C18E; Wed, 19 Jun 2013 16:13:51 -0400 (EDT) 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 3F5D69C198 for ; Wed, 19 Jun 2013 16:13:50 -0400 (EDT) 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 57pZv73Qp4+B for ; Wed, 19 Jun 2013 16:13:46 -0400 (EDT) Received: from diserzione.investici.org (diserzione.investici.org [82.221.99.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.autistici.org", Issuer "Autistici/Inventati Certification Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id D56ED9C18E for ; Wed, 19 Jun 2013 16:13:41 -0400 (EDT) Received: from [82.221.99.153] (diserzione [82.221.99.153]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 09D95180CAE; Wed, 19 Jun 2013 20:13:39 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 diserzione.investici.org 09D95180CAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1371672820; bh=YWzO7CuplhPB8jGVa/8N0FLWrIVVzHNnbZN9WFwEXro=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=qXjyxeEBqv5J3d0CO3WOLMPWPFhGQaA7haPnX3Rmz0cQgYy2uwz7Oo8jsI+MJ+yrI nmBY+jV3AMdGhytBvNUEJlQ2vBLxVPNKjh5WjBcqce/EDt9zdX79yKKDfCgub4OCUK RkLNjqMP/07AoCWJhmMud5GM/zt6aR5qK6gsdceQ= From: Antonio Quartulli To: hostap Subject: [PATCH 2/3] Register for AUTH frames when joining an IBSS network Date: Wed, 19 Jun 2013 22:11:33 +0200 Message-Id: <1371672694-1194-3-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1371672694-1194-1-git-send-email-ordex@autistici.org> References: <1371672694-1194-1-git-send-email-ordex@autistici.org> 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 34c975d..7970c9c 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -305,6 +305,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 @@ -1619,12 +1622,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));