P2P: Avoid extra group interface creation on GO reinvocation

If separate group interfaces are used, the pending group interface got
removed unnecessarily when stopping find operations when accepting an
invitation to reinvoke the group in GO role. This resulted in the group
interfaces getting created twice. Avoid this unnecessary extra operation
by skipping removal of the pending interface in the reinvocation
sequence.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2012-11-11 20:45:27 +02:00
parent 0779c227af
commit 8713a2e6ff

View file

@ -90,6 +90,7 @@ static void wpas_p2p_group_idle_timeout(void *eloop_ctx, void *timeout_ctx);
static void wpas_p2p_set_group_idle_timeout(struct wpa_supplicant *wpa_s);
static void wpas_p2p_fallback_to_go_neg(struct wpa_supplicant *wpa_s,
int group_added);
static int wpas_p2p_stop_find_oper(struct wpa_supplicant *wpa_s);
static void wpas_p2p_scan_res_handler(struct wpa_supplicant *wpa_s,
@ -3976,7 +3977,7 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group,
/* Make sure we are not running find during connection establishment */
wpa_printf(MSG_DEBUG, "P2P: Stop any on-going P2P FIND");
wpas_p2p_stop_find(wpa_s);
wpas_p2p_stop_find_oper(wpa_s);
if (freq == 2) {
wpa_printf(MSG_DEBUG, "P2P: Request to start GO on 2.4 GHz "
@ -4107,7 +4108,7 @@ int wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s,
}
/* Make sure we are not running find during connection establishment */
wpas_p2p_stop_find(wpa_s);
wpas_p2p_stop_find_oper(wpa_s);
wpa_s->p2p_fallback_to_go_neg = 0;
@ -4379,7 +4380,7 @@ int wpas_p2p_find(struct wpa_supplicant *wpa_s, unsigned int timeout,
}
void wpas_p2p_stop_find(struct wpa_supplicant *wpa_s)
static int wpas_p2p_stop_find_oper(struct wpa_supplicant *wpa_s)
{
wpas_p2p_clear_pending_action_tx(wpa_s);
wpa_s->p2p_long_listen = 0;
@ -4389,12 +4390,20 @@ void wpas_p2p_stop_find(struct wpa_supplicant *wpa_s)
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_MGMT) {
wpa_drv_p2p_stop_find(wpa_s);
return;
return 1;
}
if (wpa_s->global->p2p)
p2p_stop_find(wpa_s->global->p2p);
return 0;
}
void wpas_p2p_stop_find(struct wpa_supplicant *wpa_s)
{
if (wpas_p2p_stop_find_oper(wpa_s) > 0)
return;
wpas_p2p_remove_pending_group_interface(wpa_s);
}