P2PS: Do not remove pending interface on p2p_stop_find
authorKrishna Vamsi <vamsin@qti.qualcomm.com>
Tue, 30 Dec 2014 12:27:38 +0000 (17:57 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 2 Feb 2015 23:35:07 +0000 (01:35 +0200)
The pending interface created during provision discovery should
not be removed on stopping p2p_find. This pending interface has
to be used after completing GO negotiation. Earlier the pending
interface is created just before GO negotiation so there was no
problem.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index 643a823..d715af1 100644 (file)
@@ -748,6 +748,7 @@ grp_owner:
                                           "P2P: Failed to allocate a new interface for the group");
                                return P2PS_SETUP_NONE;
                        }
+                       wpa_s->global->pending_group_iface_for_p2ps = 1;
                        p2p_set_intended_addr(wpa_s->global->p2p,
                                              wpa_s->pending_interface_addr);
                }
@@ -1943,6 +1944,7 @@ static void wpas_p2p_remove_pending_group_interface(
                          wpa_s->pending_interface_name);
        os_memset(wpa_s->pending_interface_addr, 0, ETH_ALEN);
        wpa_s->pending_interface_name[0] = '\0';
+       wpa_s->global->pending_group_iface_for_p2ps = 0;
 }
 
 
@@ -1988,6 +1990,7 @@ wpas_p2p_init_group_interface(struct wpa_supplicant *wpa_s, int go)
        group_wpa_s->p2p_group_interface = go ? P2P_GROUP_INTERFACE_GO :
                P2P_GROUP_INTERFACE_CLIENT;
        wpa_s->global->p2p_group_formation = group_wpa_s;
+       wpa_s->global->pending_group_iface_for_p2ps = 0;
 
        wpas_p2p_clone_config(group_wpa_s, wpa_s);
 
@@ -7029,7 +7032,8 @@ static void wpas_p2p_stop_find_oper(struct wpa_supplicant *wpa_s)
 void wpas_p2p_stop_find(struct wpa_supplicant *wpa_s)
 {
        wpas_p2p_stop_find_oper(wpa_s);
-       wpas_p2p_remove_pending_group_interface(wpa_s);
+       if (!wpa_s->global->pending_group_iface_for_p2ps)
+               wpas_p2p_remove_pending_group_interface(wpa_s);
 }
 
 
index 80dda09..c80a620 100644 (file)
@@ -276,6 +276,7 @@ struct wpa_global {
        unsigned int p2p_fail_on_wps_complete:1;
        unsigned int p2p_24ghz_social_channels:1;
        unsigned int pending_p2ps_group:1;
+       unsigned int pending_group_iface_for_p2ps:1;
 
 #ifdef CONFIG_WIFI_DISPLAY
        int wifi_display;