From patchwork Wed Oct 24 16:55:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bird X-Patchwork-Id: 193862 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 2F36E2C0168 for ; Thu, 25 Oct 2012 03:55:28 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C172B9C201; Wed, 24 Oct 2012 12:55:24 -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 wD1NxfsrltOS; Wed, 24 Oct 2012 12:55:24 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 434C29C1F7; Wed, 24 Oct 2012 12:55:20 -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 C4DCD9C1F7 for ; Wed, 24 Oct 2012 12:55:19 -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 fkBtUrRDIeDN for ; Wed, 24 Oct 2012 12:55:14 -0400 (EDT) Received: from mail.coova.com (mail.coova.com [174.129.226.51]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id DC3BC9C1F5 for ; Wed, 24 Oct 2012 12:55:14 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.coova.com (Postfix) with ESMTP id 6501142C75 for ; Wed, 24 Oct 2012 16:54:54 +0000 (UTC) Received: from mail.coova.com ([127.0.0.1]) by localhost (ip-10-190-129-192.ec2.internal [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nWJwQb+JqAZL for ; Wed, 24 Oct 2012 16:54:54 +0000 (UTC) Message-ID: <1351097713.6771.5.camel@david-laptop> Subject: EAPOL issue when switching between SSIDs From: David Bird To: hostap@lists.shmoo.com Date: Wed, 24 Oct 2012 09:55:13 -0700 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 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: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Greetings, There is an issue with associating to SSIDs using WPA when there are multiple SSIDs being controlled by hostapd and when you are switching between SSIDs. When processing the EAPOL packet, the array of virtual APs (iface->bss) is searched looking for the station that sent the packet in order to identify which signal context should be used during processing. The first signal with the station in it's list gets used in the ieee802_1x_receive() function. However, even after a station has disassociated from a signal, it remains in that signals list of stations pending an inactivity timeout. This leads to the wrong signal context (one where the station had already disassociated) being used in some cases (if the current/active bss entry appears in the list AFTER one where the station has just disassociated from) for EAPOL processing. The attached patch checks for the WLAN_STA_ASSOC flag before assuming it found the 'right' signal context for the given station. Signed-hostap: David Bird diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 23fa241..0200435 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -672,12 +673,15 @@ static void hostapd_event_eapol_rx(struct hostapd_data *hapd, const u8 *src, const u8 *data, size_t data_len) { struct hostapd_iface *iface = hapd->iface; + struct sta_info *sta; size_t j; for (j = 0; j < iface->num_bss; j++) { - if (ap_get_sta(iface->bss[j], src)) { - hapd = iface->bss[j]; - break; + if ((sta = ap_get_sta(iface->bss[j], src))) { + if (sta->flags & WLAN_STA_ASSOC) { + hapd = iface->bss[j]; + break; + } } }