From patchwork Thu Oct 25 02:59:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: P2P: Do not append WPS and P2P IE for the interface not support P2P X-Patchwork-Submitter: Stone Piao X-Patchwork-Id: 194018 Message-Id: To: "hostap@lists.shmoo.com" Cc: Kevin Gan , Cathy Luo , Tristan Xu Date: Wed, 24 Oct 2012 19:59:00 -0700 From: Stone Piao List-Id: HostAP Project 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) {