]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fallback to GO negotiation after running out of GO scan attempts
authorJimmy Chen <jimmycmchen@google.com>
Wed, 2 Sep 2020 08:50:11 +0000 (16:50 +0800)
committerJouni Malinen <j@w1.fi>
Sun, 11 Oct 2020 17:00:57 +0000 (20:00 +0300)
We found a problem that p2p_fallback_to_go_neg is not handled correctly
after running out of GO scan attempts. When autojoin is enabled and a
group is found in old scan results, supplicant would try to scan the
group several times. If the group is still not found, it reports group
formation failure while p2p_fallback_to_go_neg is enabled already.

If p2p_fallback_to_go_neg is enabled, it should fallback to GO
negotiation, but not report group formation failure after running out of
GO scan attempts.

Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
wpa_supplicant/p2p_supplicant.c

index 64ba34450563e1116f5071f5200262bd2e29e19a..78798151fc335da15639aab9f548c56479e38579 100644 (file)
@@ -4977,6 +4977,15 @@ static void wpas_p2p_check_join_scan_limit(struct wpa_supplicant *wpa_s)
                                       MAC2STR(wpa_s->pending_join_dev_addr));
                        return;
                }
+               if (wpa_s->p2p_fallback_to_go_neg) {
+                       wpa_dbg(wpa_s, MSG_DEBUG,
+                               "P2P: Join operation failed - fall back to GO Negotiation");
+                       wpa_msg_global(wpa_s->p2pdev, MSG_INFO,
+                                      P2P_EVENT_FALLBACK_TO_GO_NEG
+                                      "reason=join-failed");
+                       wpas_p2p_fallback_to_go_neg(wpa_s, 0);
+                       return;
+               }
                wpa_msg_global(wpa_s->p2pdev, MSG_INFO,
                               P2P_EVENT_GROUP_FORMATION_FAILURE);
                wpas_notify_p2p_group_formation_failure(wpa_s, "");