From patchwork Mon Mar 5 14:01:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 144680 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 39432B6FA3 for ; Tue, 6 Mar 2012 01:01:51 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 77A4F9D1EF; Mon, 5 Mar 2012 09:01:45 -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 qNAzgClqtkl5; Mon, 5 Mar 2012 09:01:45 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 72C789C1BE; Mon, 5 Mar 2012 09:01:41 -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 A4BE59C1BE for ; Mon, 5 Mar 2012 09:01:39 -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 0eVDJtyvHYTV for ; Mon, 5 Mar 2012 09:01:35 -0500 (EST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) (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 6C8CC9C1B9 for ; Mon, 5 Mar 2012 09:01:35 -0500 (EST) Received: by wicr5 with SMTP id r5so3034699wic.17 for ; Mon, 05 Mar 2012 06:01:34 -0800 (PST) Received-SPF: pass (google.com: domain of eliad@wizery.com designates 10.216.139.69 as permitted sender) client-ip=10.216.139.69; Authentication-Results: mr.google.com; spf=pass (google.com: domain of eliad@wizery.com designates 10.216.139.69 as permitted sender) smtp.mail=eliad@wizery.com Received: from mr.google.com ([10.216.139.69]) by 10.216.139.69 with SMTP id b47mr6279490wej.17.1330956094446 (num_hops = 1); Mon, 05 Mar 2012 06:01:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:to:subject:date:message-id:x-mailer :x-gm-message-state; bh=fHJztiiSP9nQJ3gz88pfzrRbGBcs3Letbk2DIV/h7kg=; b=U82uxyfOECfQu+2AjsIlmgk8mcR5mGFrWbkW28TjATi7Jnx3OMX+NCqdXkFj5QXzuH x1t8WirMP0C/qDD900qwcOLYB9kQf/1v+P6L7NCiARv6JyeiUHx9S/V2mOpk2Q3Ragv/ riQPY7/zNE8BXkxMF+vksyk1wDOq+yHohMlVKf9vqBhse05Ltijzjx8uo5n+0WEn/PPm tMHHvnzxCs5Dh3Q3ufewspiLgMOoSH3lIwywoSvxVyXRAkfI+AD6x6EulD9AxY4KHKdx 4UWNAtTqC6Is1EdR1bWPX0NLv8qkgZikh1wRlAJzm+ToSBOkHPHNhK7F3HS6cGccCB8U am3Q== MIME-Version: 1.0 Received: by 10.216.139.69 with SMTP id b47mr5043134wej.17.1330956094376; Mon, 05 Mar 2012 06:01:34 -0800 (PST) Received: from localhost.localdomain (93-172-241-23.bb.netvision.net.il. [93.172.241.23]) by mx.google.com with ESMTPS id 9sm62512204wid.2.2012.03.05.06.01.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 06:01:33 -0800 (PST) From: Eliad Peller To: Subject: [PATCH] P2P: notify about disconnection only when needed Date: Mon, 5 Mar 2012 16:01:51 +0200 Message-Id: <1330956111-14870-1-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.7.6.401.g6a319 X-Gm-Message-State: ALoCoQlckwdsmKhhHQD6XjzNxqX0rulJCryZNjQ7Od7WKHfaV7/GN5qOBg8LzW2JVYIML1aUn2QY 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 wpas_notify_state_changed() notifies about disconnection when new_state < WPA_ASSOCIATED, without checking the old state. This finally might fire the p2p idle group timer during the connection attempt. Signed-hostap: Eliad Peller intended-for: hostap-1 --- wpa_supplicant/notify.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c index da98a14..8d9b669 100644 --- a/wpa_supplicant/notify.c +++ b/wpa_supplicant/notify.c @@ -82,7 +82,7 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s, #ifdef CONFIG_P2P if (new_state == WPA_COMPLETED) wpas_p2p_notif_connected(wpa_s); - else if (new_state < WPA_ASSOCIATED) + else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED) wpas_p2p_notif_disconnected(wpa_s); #endif /* CONFIG_P2P */