From patchwork Tue Dec 27 05:23:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Jance X-Patchwork-Id: 133295 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 1816AB701C for ; Tue, 27 Dec 2011 16:24:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id AF9299C12C; Tue, 27 Dec 2011 00:24:32 -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 feIAwiBxGyG4; Tue, 27 Dec 2011 00:24:32 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 763749C130; Tue, 27 Dec 2011 00:24:28 -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 BDC279C130 for ; Tue, 27 Dec 2011 00:24:27 -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 UIqQrnep+SpR for ; Tue, 27 Dec 2011 00:24:22 -0500 (EST) Received: from MMS3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4C0069C12C for ; Tue, 27 Dec 2011 00:24:22 -0500 (EST) Received: from [10.16.192.232] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Mon, 26 Dec 2011 21:31:37 -0800 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: from SJEXCHCCR01.corp.ad.broadcom.com ([10.252.49.130]) by SJEXCHHUB02.corp.ad.broadcom.com ([10.16.192.232]) with mapi; Mon, 26 Dec 2011 21:23:55 -0800 From: "Jithu Jance" To: "hostap@lists.shmoo.com" Date: Mon, 26 Dec 2011 21:23:54 -0800 Subject: FW: [PATCH] P2P: Fix inconsistency in displaying wps pin Thread-Topic: [PATCH] P2P: Fix inconsistency in displaying wps pin Thread-Index: Acy9sYvio5TE0PWOQu2S9Xvsc1ETfABFq1QgAWOAnjA= Message-ID: <0BED5F74AB839C4796CA2BFC2BC311B419C433044C@SJEXCHCCR01.corp.ad.broadcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-WSS-ID: 62E787B35048161339-01-01 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 >>> In this particular sequence, I don't really see much point in even >>> displaying the P2P-PROV-DISC-SHOW-PIN event. In fact, it does not >>> necessarily even get shown if the Provision Discovery Response is not >>> received > but the UI program that issued the > p2p_connect command in the first place better know which end is going to > be displaying the PIN and it should be able to figure out easily that > the value returned by p2p_connect is this. > there is no > guarantee on this event being shown in this join-a-running-group case.. Sounds like for "p2p_connect pin display join" command, suppressing Prov Disc SHOW-PIN would be a better approach. I would also like to confirm about the handling of wpas_notify_p2p_provision_discovery in this particular scenario. Is it okay to invoke the function with generated_pin = 0 value (the below patch uses this approach) or should I suppress the invocation of wpas_notify_p2p_provision_discovery when wpas->p2p_pin is populated?? Signed-hostap: Jithu Jance --- wpa_supplicant/p2p_supplicant.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 5ff94ef..85be08a 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -1785,8 +1785,7 @@ void wpas_prov_disc_req(void *ctx, const u8 *peer, u16 config_methods, group ? " group=" : "", group ? group->ifname : ""); params[sizeof(params) - 1] = '\0'; - - if (config_methods & WPS_CONFIG_DISPLAY) { + if ((config_methods & WPS_CONFIG_DISPLAY) && (wpa_s->p2p_pin[0] == '\0')) { generated_pin = wps_generate_pin(); wpas_prov_disc_local_display(wpa_s, peer, params, generated_pin); @@ -1809,7 +1808,7 @@ void wpas_prov_disc_resp(void *ctx, const u8 *peer, u16 config_methods) if (config_methods & WPS_CONFIG_DISPLAY) wpas_prov_disc_local_keypad(wpa_s, peer, ""); - else if (config_methods & WPS_CONFIG_KEYPAD) { + else if ((config_methods & WPS_CONFIG_KEYPAD) && (wpa_s->p2p_pin[0] == '\0')) { generated_pin = wps_generate_pin(); wpas_prov_disc_local_display(wpa_s, peer, "", generated_pin); } else if (config_methods & WPS_CONFIG_PUSHBUTTON)