diff mbox series

p2p: fallback to p2p neg after running out of GO scan attempts.

Message ID CALoVRkMzEvGUv4cu1KG84MN7Ub9Ys1Uz9w11=y0K4-zPAgC+4Q@mail.gmail.com
State Accepted
Headers show
Series p2p: fallback to p2p neg after running out of GO scan attempts. | expand

Commit Message

Jimmy Chen Sept. 2, 2020, 9:40 a.m. UTC
Hi,

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.

Best regards,
Jimmy

Thank you for your time and consideration.

Best regards,
Jimmy

Comments

Jouni Malinen Oct. 11, 2020, 6:27 p.m. UTC | #1
On Wed, Sep 02, 2020 at 05:40:48PM +0800, Jimmy Chen wrote:
> If p2p_fallback_to_go_neg is enabled, it should fallback
> to go neg, but not report group formation failure after
> running out of GO scan attempts.

Thanks, applied.
diff mbox series

Patch

From f1870193055af204b5f79a4b1590e8e9d26b6903 Mon Sep 17 00:00:00 2001
From: Jimmy Chen <jimmycmchen@google.com>
Date: Wed, 2 Sep 2020 16:50:11 +0800
Subject: [PATCH] p2p: fallback to p2p neg after running out of GO scan
 attempts.

If p2p_fallback_to_go_neg is enabled, it should fallback
to go neg, 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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index d7b81ceb0..7ffb94592 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4917,6 +4917,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 operating "
+				"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, "");
-- 
2.28.0.526.ge36021eeef-goog