P2PS: Use wpas_p2p_create_iface() to check if dedicated iface is needed
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Thu, 2 Jul 2015 07:45:03 +0000 (10:45 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jul 2015 17:30:12 +0000 (20:30 +0300)
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@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
wpa_supplicant/p2p_supplicant.c

index b9ebd38..aeaa114 100644 (file)
@@ -606,7 +606,7 @@ 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;
+       p2p_no_group_iface = !wpas_p2p_create_iface(wpa_s);
 
        wpa_printf(MSG_DEBUG, "P2P: GO(iface)=%p persistent(ssid)=%p",
                   go_wpa_s, persistent_go);
@@ -3742,7 +3742,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;