]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix p2p_in_provisioning clearing in failure case
authorWu Gao <wugao@qti.qualcomm.com>
Tue, 13 Jun 2017 11:45:49 +0000 (14:45 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 13 Jun 2017 11:49:36 +0000 (14:49 +0300)
wpa_s->p2p_in_provisioning needs to be cleared when group formation
fully completes. The change to postpone GO side handling to the first
data connection in commit 41f853235fe1d1fad1acecc0ee5dfe81c872c6b2
('P2P: Extend group formation timeout on GO to first data connection')
resulted in making this not happen in one P2P Client side case: EAP-WSC
timeout in PBC case. While that is quite special case since it requires
30 second timeout without receiving new EAPOL frames and not getting
disassociation, it can apparently happen in some cases in practice. This
would result in new P2P operations (e.g., P2P_FIND) getting rejected
until wpa_supplicant is restarted.

Fix this by clearing wpa_s->p2p_in_provisioning whenever processing a
group formation failure case. For group formation success,
wpa_s->p2p_in_provisioning is left set to non-zero value to avoid
breaking the earlier limits on the GO side.

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

index 413e4e00b84cc782abda9eea94add61fce63b940..578d9901a11208dd5d3dd3ff92b5eb3df7779d37 100644 (file)
@@ -1320,6 +1320,10 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
        if (wpa_s->p2p_go_group_formation_completed) {
                wpa_s->global->p2p_group_formation = NULL;
                wpa_s->p2p_in_provisioning = 0;
+       } else if (wpa_s->p2p_in_provisioning && !success) {
+               wpa_msg(wpa_s, MSG_DEBUG,
+                       "P2P: Stop provisioning state due to failure");
+               wpa_s->p2p_in_provisioning = 0;
        }
        wpa_s->p2p_in_invitation = 0;
        wpa_s->group_formation_reported = 1;