[PATCH 05/10] P2PS: Use wpas_p2p_create_iface() to check if dedicated iface is needed

Ilan Peer ilan.peer
Thu Jul 2 00:45:03 PDT 2015


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

Call wpas_p2p_create_iface() instead of just checking p2p_no_group_iface
config value. Not doing so, resulted in an incorrect behavior when the
driver sets WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE flag.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
Reviewed-by: Ilan Peer <ilan.peer at intel.com>
---
 wpa_supplicant/p2p_supplicant.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index b9ebd38..9142a85 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -594,7 +594,7 @@ static u8 p2ps_group_capability(void *ctx, u8 incoming, u8 role)
 	unsigned int client = 0;
 	struct wpa_supplicant *go_wpa_s;
 	struct wpa_ssid *persistent_go;
-	int p2p_no_group_iface;
+	int p2p_no_group_iface = !wpas_p2p_create_iface(wpa_s);
 
 	wpa_printf(MSG_DEBUG, "P2P: Conncap - in:%d role:%d", incoming, role);
 
@@ -606,7 +606,6 @@ static u8 p2ps_group_capability(void *ctx, u8 incoming, u8 role)
 	 */
 	go_wpa_s = wpas_p2p_get_go_group(wpa_s);
 	persistent_go = wpas_p2p_get_persistent_go(wpa_s);
-	p2p_no_group_iface = wpa_s->conf->p2p_no_group_iface;
 
 	wpa_printf(MSG_DEBUG, "P2P: GO(iface)=%p persistent(ssid)=%p",
 		   go_wpa_s, persistent_go);
@@ -3742,7 +3741,7 @@ static void wpas_p2ps_prov_complete(void *ctx, u8 status, const u8 *dev,
 		if (!go_wpa_s) {
 			wpa_s->global->pending_p2ps_group = 1;
 
-			if (wpa_s->conf->p2p_no_group_iface)
+			if (!wpas_p2p_create_iface(wpa_s))
 				go_ifname = wpa_s->ifname;
 			else if (wpa_s->pending_interface_name[0])
 				go_ifname = wpa_s->pending_interface_name;
-- 
1.9.1




More information about the Hostap mailing list