[PATCH 1/2] P2P: improve deinit for go neg non-zero status

Jouni Malinen j
Mon May 12 08:18:28 PDT 2014

On Sun, May 11, 2014 at 12:54:43PM -0400, Eduardo Abinader wrote:
> Added cancel timeout and issuing formation failed, in order
> to improve detection for group formation failure, upon
> non-zero status.

> diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
> @@ -1590,6 +1590,8 @@ static void wpas_go_neg_completed(void *ctx, struct p2p_go_neg_results *res)
>  			       res->status);
>  		wpas_notify_p2p_go_neg_completed(wpa_s, res);
>  		wpas_p2p_remove_pending_group_interface(wpa_s);
> +		eloop_cancel_timeout(wpas_p2p_long_listen_timeout, wpa_s, NULL);
> +		wpas_p2p_group_formation_failed(wpa_s);
>  		return;
>  	}

I can understand the wpas_p2p_group_formation_failed() call, but what is
the purpose of canceling wpas_p2p_long_listen_timeout here? Actually,
that same question would really apply for the earlier commit
5eae87a7d61b053fb315c667f97954d004c195a5 ('P2P: Fix GO failed interface
init') as well.. That was the only place where that
eloop_cancel_timeout() was introduced without clearing
wpa_s->p2p_long_listen to zero.

The p2p_long_listen and its timeout mechanism are used to stop long
listen operation so that it does not trigger during group formation
steps. Doing that in failure cases looks a bit odd. I think I'd rather
remove that previously added eloop_cancel_timeout() and this one here as
well, unless there is a good reason for these that I cannot currently
think of. These changes would also make patch 2/2 less useful (and well,
if it should be added, I'd say it should also do wpa_s->p2p_long_listen
= 0).

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list