]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Send connection status result if disconnected during 4-way HS
authorChenming Huang <quic_chenhuan@quicinc.com>
Thu, 23 Jan 2025 02:07:39 +0000 (07:37 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 13 Feb 2025 20:44:38 +0000 (22:44 +0200)
Connection status result was reported during failed 4-way handshake if
that failure might have been due to an incorrect phassphrase/password.
4-eay handshake might fail for other reasons and if that is the case,
the connection status result is delayed unnecessarily long untile the 15
second timeout occurs.

Optimize this by sending out the connection status result in all
disconnection cases that happen before the 4-way handshake has been
completed successfully.

Signed-off-by: Chenming Huang <quic_chenhuan@quicinc.com>
wpa_supplicant/events.c

index cf8f0667cd036ad7007f02c68bbd1679f0de2188..ec29deae1bb2520beb7824014698d64ce3247fb1 100644 (file)
@@ -4718,10 +4718,6 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s,
                        return; /* P2P group removed */
                wpas_auth_failed(wpa_s, "WRONG_KEY", wpa_s->pending_bssid);
                wpas_notify_psk_mismatch(wpa_s);
-#ifdef CONFIG_DPP2
-               wpas_dpp_send_conn_status_result(wpa_s,
-                                                DPP_STATUS_AUTH_FAILURE);
-#endif /* CONFIG_DPP2 */
        }
        if (!wpa_s->disconnected &&
            (!wpa_s->auto_reconnect_disabled ||
@@ -4776,6 +4772,9 @@ static void wpa_supplicant_event_disassoc_finish(struct wpa_supplicant *wpa_s,
        else
                wpa_s->disconnect_reason = reason_code;
        wpas_notify_disconnect_reason(wpa_s);
+#ifdef CONFIG_DPP2
+       wpas_dpp_send_conn_status_result(wpa_s, DPP_STATUS_AUTH_FAILURE);
+#endif /* CONFIG_DPP2 */
        if (wpa_supplicant_dynamic_keys(wpa_s)) {
                wpa_dbg(wpa_s, MSG_DEBUG, "Disconnect event - remove keys");
                wpa_clear_keys(wpa_s, wpa_s->bssid);