From patchwork Wed May 30 06:32:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 161869 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 02D40B6FC4 for ; Wed, 30 May 2012 16:33:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id CFF549C234; Wed, 30 May 2012 02:33:03 -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 vgTDVdmlAg5o; Wed, 30 May 2012 02:33:03 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id EEEDB9D1F3; Wed, 30 May 2012 02:32:59 -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 903689D1F3 for ; Wed, 30 May 2012 02:32:58 -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 NYOjwO-5cnC7 for ; Wed, 30 May 2012 02:32:54 -0400 (EDT) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 67FFD9C234 for ; Wed, 30 May 2012 02:32:54 -0400 (EDT) Received: by wibhm6 with SMTP id hm6so2584282wib.5 for ; Tue, 29 May 2012 23:32:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=p7Q515Jt+UWLRMVVle7e19ETS3Q7klZK9V/4ReQGnro=; b=MJ9waFfD+DG6Kcz2PLvdYfIYEYLRLN1xVacDOHnh4p8MWtsk5Mi3msBZEsPWuT4ztM 7Leu8z75F0695CScoWpS9ZxpHaOd95aiVZi/Z9mP5n4WmrLliq5aqFxJsd1Inzjmj2ol r9o8lAgFoyRVdbOWuldWo9SUTF6j4aBqeufP4/ncWZEKGbXuUAXxlODt5WbF8Mbivo8c xx3uToYkKQ2/xq0h4/FzNFiitlBugnBaEe9Et1v2E6Fmde3aF7yWVzsxgpcTubszKJJv P6HGacA4tor3st6/Or8vEcBhIKdgUFdgi7FyRLOKoyNcbM+/AsV+qhAFj7Jwp5+1f1NK iXIA== Received: by 10.216.218.144 with SMTP id k16mr9419577wep.215.1338359573002; Tue, 29 May 2012 23:32:53 -0700 (PDT) Received: from pluto.Home (93-173-11-6.bb.netvision.net.il. [93.173.11.6]) by mx.google.com with ESMTPS id m20sm24366835wie.6.2012.05.29.23.32.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 May 2012 23:32:51 -0700 (PDT) From: Arik Nemtsov To: hostap@lists.shmoo.com Subject: [PATCH] wpa_supplicant: clear bssid state on deauth Date: Wed, 30 May 2012 09:32:48 +0300 Message-Id: <1338359568-11869-1-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmnnBM/BnPT+p+aYgeRd9C0TweIN1COLaw0/+a0NWSV2V5JM/MzBJicVmjBAGb73zaZTnkt Cc: Arik Nemtsov 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 When de-authenticated by an AP, the state of wpa_s should be cleared, especially the previous bssid. Otherwise, we will use re-assoc packets when associating to the same AP. This is not according to spec, and some APs refuse to association. Reported-by: Yossi Wortzel Signed-hostap: Arik Nemtsov --- I'm not 100% sure with this patch, I just tried to copy the relevant parts from sme_deauth(). But it definitely fixed some real world issues we encountered with a mac80211 based driver. With prev_bssid_set == 1, re-assoc packets are used in mac80211 during association. wpa_supplicant/events.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index d09be6c..b8b25f6 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -2246,6 +2246,18 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, data->deauth_info.ie, data->deauth_info.ie_len); } + +#ifdef CONFIG_AP + if (wpa_s->ap_iface == NULL) +#endif /* CONFIG_AP */ + { +#ifdef CONFIG_SME + wpa_s->sme.prev_bssid_set = 0; +#endif /* CONFIG_SME */ + wpa_supplicant_set_state(wpa_s, + WPA_DISCONNECTED); + os_memset(wpa_s->bssid, 0, ETH_ALEN); + } } #ifdef CONFIG_AP if (wpa_s->ap_iface && data && data->deauth_info.addr) {