From patchwork Mon Nov 7 14:33:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 124090 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 257F2B6F75 for ; Tue, 8 Nov 2011 01:34:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 088999C135; Mon, 7 Nov 2011 09:34:15 -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 uM85nFIgYuZv; Mon, 7 Nov 2011 09:34:14 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E82EE9C167; Mon, 7 Nov 2011 09:33:58 -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 10B9A9C167 for ; Mon, 7 Nov 2011 09:33:57 -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 Yinyw0flrqsj for ; Mon, 7 Nov 2011 09:33:53 -0500 (EST) Received: from sipsolutions.net (he.sipsolutions.net [78.46.109.217]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 622C09C135 for ; Mon, 7 Nov 2011 09:33:53 -0500 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.77) (envelope-from ) id 1RNQGl-0002nF-0x; Mon, 07 Nov 2011 15:33:51 +0100 Subject: [PATCH] P2P: clear WPS method when GO negotiation fails From: Johannes Berg To: hostap Date: Mon, 07 Nov 2011 15:33:48 +0100 Message-ID: <1320676428.3993.44.camel@jlt3.sipsolutions.net> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 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 From: Johannes Berg When GO negotation fails the WPS method is currently not cleared, which can result in GO negotiation being resumed when a GO negotiation request frame from is received from the peer. That is unexpected as locally we already gave up. This manifests itself in getting 1319574733.955685: wlan0: P2P-GO-NEG-FAILURE status=-1 1319574733.955723: P2P: Removing pending group interface p2p-wlan0-0 ... 1319574736.648378: wlan0: P2P: Starting GO Negotiation with previously authorized peer ... 1319574736.650115: wlan0: P2P: Sending GO Negotiation Response ... 1319574736.988038: wlan0: P2P-GO-NEG-SUCCESS 1319574736.988233: P2P: No pending group interface 1319574736.988268: P2P: Create a new interface p2p-wlan0-1 for the group Clear the WPS method to avoid this situation. I wasn't able to test this though, but given the log I can only assume this is how the situation happened. Reported-by: Reinette Chatre Signed-hostap: Johannes Berg --- src/p2p/p2p.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 0f2a5d2..382e6b6 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -144,6 +144,8 @@ void p2p_go_neg_failed(struct p2p_data *p2p, struct p2p_device *peer, struct p2p_go_neg_results res; p2p_clear_timeout(p2p); p2p_set_state(p2p, P2P_IDLE); + if (p2p->go_neg_peer) + p2p->go_neg_peer->wps_method = WPS_NOT_READY; p2p->go_neg_peer = NULL; os_memset(&res, 0, sizeof(res));