From b21ff9cb20657e293db139f86b6d90a202c452c2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 27 Jan 2012 21:09:34 +0200 Subject: [PATCH] P2P: Fix WSC IE inclusion for P2P disabled case wpas_wps_in_use() was forcing WPS to be enabled unconditionally if P2P support was included in the build. This is not really the correct behavior for the case when P2P has been disabled at runtime. Change the code here to verify runtime configuration of P2P before forcing WPS to be enabled. This allows WSC IE to be left out from Probe Request frames when scanning for APs without P2P or WPS being in use. Signed-hostap: Jouni Malinen --- wpa_supplicant/scan.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 16f2bbf..5135892 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -71,10 +71,12 @@ static int wpas_wps_in_use(struct wpa_supplicant *wpa_s, } #ifdef CONFIG_P2P - wpa_s->wps->dev.p2p = 1; - if (!wps) { - wps = 1; - *req_type = WPS_REQ_ENROLLEE_INFO; + if (!wpa_s->global->p2p_disabled && wpa_s->global->p2p) { + wpa_s->wps->dev.p2p = 1; + if (!wps) { + wps = 1; + *req_type = WPS_REQ_ENROLLEE_INFO; + } } #endif /* CONFIG_P2P */ -- 2.1.4