From patchwork Fri Sep 14 13:12:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 183921 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 5931C2C0085 for ; Fri, 14 Sep 2012 23:13:41 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id AE1179C0D0; Fri, 14 Sep 2012 09:13:18 -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 VQ1d+xNLwj8L; Fri, 14 Sep 2012 09:13:18 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id A2ECB9C0D9; Fri, 14 Sep 2012 09:12:49 -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 63FE29D289 for ; Fri, 14 Sep 2012 09:12:47 -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 pHERviNQnpir for ; Fri, 14 Sep 2012 09:12:42 -0400 (EDT) Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 1F5029D282 for ; Fri, 14 Sep 2012 09:12:33 -0400 (EDT) Received: by nf.local (Postfix, from userid 501) id 188B37BB965; Fri, 14 Sep 2012 15:12:29 +0200 (CEST) From: Felix Fietkau To: hostap@lists.shmoo.com Subject: [PATCH 3/5] hostapd: clear WLAN_STA_ASSOC_REQ_OK if sending the assoc response failed Date: Fri, 14 Sep 2012 15:12:27 +0200 Message-Id: <1347628349-34362-3-git-send-email-nbd@openwrt.org> X-Mailer: git-send-email 1.7.9.6 (Apple Git-31.1) In-Reply-To: <1347628349-34362-2-git-send-email-nbd@openwrt.org> References: <1347628349-34362-1-git-send-email-nbd@openwrt.org> <1347628349-34362-2-git-send-email-nbd@openwrt.org> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 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 As long as WLAN_STA_ASSOC_REQ_OK is set in sta->flags, Class 3 frames do not trigger a disassoc/deauth. If it is still set even after the assoc response tx has already failed, it may take somewhat longer for clients to realize that the connection wasn't fully established. Signed-hostap: Felix Fietkau --- src/ap/ieee802_11.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 211ee1b..4b6e9d7 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -1506,13 +1506,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd, int new_assoc = 1; struct ieee80211_ht_capabilities ht_cap; - if (!ok) { - hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_DEBUG, - "did not acknowledge association response"); - return; - } - if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) : sizeof(mgmt->u.assoc_resp))) { printf("handle_assoc_cb(reassoc=%d) - too short payload " @@ -1520,11 +1513,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd, return; } - if (reassoc) - status = le_to_host16(mgmt->u.reassoc_resp.status_code); - else - status = le_to_host16(mgmt->u.assoc_resp.status_code); - sta = ap_get_sta(hapd, mgmt->da); if (!sta) { printf("handle_assoc_cb: STA " MACSTR " not found\n", @@ -1532,6 +1520,19 @@ static void handle_assoc_cb(struct hostapd_data *hapd, return; } + if (!ok) { + hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, + "did not acknowledge association response"); + sta->flags &= ~WLAN_STA_ASSOC_REQ_OK; + return; + } + + if (reassoc) + status = le_to_host16(mgmt->u.reassoc_resp.status_code); + else + status = le_to_host16(mgmt->u.assoc_resp.status_code); + if (status != WLAN_STATUS_SUCCESS) goto fail;