From patchwork Thu Oct 25 02:59:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stone Piao X-Patchwork-Id: 194018 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 3DD472C009A for ; Thu, 25 Oct 2012 14:05:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6CC3D9C216; Wed, 24 Oct 2012 23:05:23 -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 xTNgaGM11Ign; Wed, 24 Oct 2012 23:05:23 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8FFBA17C003; Wed, 24 Oct 2012 23:05:16 -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 A13169C21E for ; Wed, 24 Oct 2012 23:05:14 -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 e7UaIKL0TMt6 for ; Wed, 24 Oct 2012 23:05:10 -0400 (EDT) Received: from na3sys009aog105.obsmtp.com (na3sys009aog105.obsmtp.com [74.125.149.75]) (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 4B06F9C216 for ; Wed, 24 Oct 2012 23:05:10 -0400 (EDT) Received: from SC-OWA01.marvell.com ([199.233.58.136]) (using TLSv1) by na3sys009aob105.postini.com ([74.125.148.12]) with SMTP ID DSNKUIisZVvw56r7DXjmhYao6vhEK6x93WwE@postini.com; Wed, 24 Oct 2012 20:05:10 PDT Received: from SC-VEXCH4.marvell.com ([0000:0000:0000:0000:0000:0000:0.0.0.1]) by SC-OWA01.marvell.com ([10.93.76.21]) with mapi; Wed, 24 Oct 2012 19:58:45 -0700 From: Stone Piao To: "hostap@lists.shmoo.com" Date: Wed, 24 Oct 2012 19:59:00 -0700 Subject: [PATCH] P2P: Do not append WPS and P2P IE for the interface not support P2P Thread-Topic: [PATCH] P2P: Do not append WPS and P2P IE for the interface not support P2P Thread-Index: Ac2yXK6qJVV5dfbvTESiQCcSPR4OcQ== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Cc: Kevin Gan , Cathy Luo , Tristan Xu 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 Hi All, When we start wpa_supplicant on one interface and we do not issue WPS_PBC or WPS_PIN cmd on wpa_cli to activate WPS, then there is no WPS IE in the probe requests. However, if we start wpa_supplicant to control two interfaces and one of them supports P2P feature, then all the probe requests will contain WPS and P2P IE even if we do not activate WPS. So the following patch is generated to fix this. Any comments are appreciated, thanks a lot. From c5336ef55d4fc05396c68aeec16ba427d8c8941e Mon Sep 17 00:00:00 2001 From: Stone Piao Date: Wed, 24 Oct 2012 13:52:58 -0400 Subject: [PATCH] P2P: Do not append WPS and P2P IE for the interface not support P2P When start one wpa_supplicant to control two interfaces and the first one is only supports WPS and the other one supports both WPS and P2P, we should not append WPS and P2P IE on the first one when it is not in WPS active mode, or there will be WPS and P2P IE in the probe request from the first interface all the time. Signed-off-by: Stone Piao --- wpa_supplicant/scan.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -- diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 68bdc59..59c7864 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -66,7 +66,8 @@ static int wpas_wps_in_use(struct wpa_supplicant *wpa_s, } #ifdef CONFIG_P2P - if (!wpa_s->global->p2p_disabled && wpa_s->global->p2p && + if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CAPABLE && + !wpa_s->global->p2p_disabled && wpa_s->global->p2p && !wpa_s->conf->p2p_disabled) { wpa_s->wps->dev.p2p = 1; if (!wps) {