P2P: Fix WSC IE inclusion for P2P disabled case
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 27 Jan 2012 19:09:34 +0000 (21:09 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 27 Jan 2012 19:09:34 +0000 (21:09 +0200)
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 <jouni@qca.qualcomm.com>

wpa_supplicant/scan.c

index 16f2bbf..5135892 100644 (file)
@@ -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 */