wpas_p2p_group_formation_timeout and p2p_group_formation

Michael Olbrich m.olbrich at pengutronix.de
Mon Nov 30 02:54:39 PST 2015


Hi,

I am experiencing some problems with P2P connections as client. From what I
can tell what happens is this:

in wpas_p2p_wps_success():
[...]
wpa_s->p2p_go_group_formation_completed = 1;
[...]
eloop_register_timeout(P2P_MAX_INITIAL_CONN_WAIT, 0,
		       wpas_p2p_group_formation_timeout,
		       wpa_s->parent, NULL);
[...]
wpas_group_formation_completed(wpa_s, 1, 0);

and then in wpas_group_formation_completed():
[...]
wpa_s->global->p2p_group_formation = NULL;
[...]

This causes two problems:
1. p2p_ext_listen_timeout() calls p2p_listen() because is_p2p_in_progress()
returns 0. At least on my hardware (Intel Corporation Wireless 7260) this
breaks connecting if the p2p_listen() happens before the group is really
fully ready.

2. If the peer cancels the connection at this point and
wpas_p2p_group_formation_timeout() is called, then
wpas_group_formation_completed() uses the wrong wpa_s (the management
interface) because "wpa_s->global->p2p_group_formation" is no longer set.

I 'fixed' this by not clearing p2p_group_formation in
wpas_group_formation_completed() (see diff below). But I don't think this
is the correct solution. Maybe p2p_go_group_formation_completed needs to be
handled differently?

Regards,
Michael

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index a60ae6e67668..cc478afabc6e 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -1307,7 +1307,6 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
 	if (wpa_s->global->p2p_group_formation)
 		wpa_s = wpa_s->global->p2p_group_formation;
 	if (wpa_s->p2p_go_group_formation_completed) {
-		wpa_s->global->p2p_group_formation = NULL;
 		wpa_s->p2p_in_provisioning = 0;
 	}
 	wpa_s->p2p_in_invitation = 0;

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the Hostap mailing list