From 3adc1c623e8ebf44b5ad0ff0aac279686b030e3e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 13 Aug 2020 17:05:49 +0300 Subject: [PATCH] DPP2: Disconnect before starting reconfiguration The offchannel operations (scan, Public Action frame TX/RX) have significantly more latency when performed while connected, so disconnect when requested to initiate DPP reconfiguration to avoid this. The old network profile (i.e., likely the current connection) is going to be replaced in practice and as such, there is no need to try continue that association any further. Signed-off-by: Jouni Malinen --- wpa_supplicant/dpp_supplicant.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index 7d226ac76..6dc0002eb 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -3690,6 +3690,12 @@ int wpas_dpp_reconfig(struct wpa_supplicant *wpa_s, const char *cmd) "DPP: Failed to generate E-id for reconfiguration"); return -1; } + if (wpa_s->wpa_state >= WPA_AUTHENTICATING) { + wpa_printf(MSG_DEBUG, "DPP: Disconnect for reconfiguration"); + wpa_s->own_disconnect_req = 1; + wpa_supplicant_deauthenticate( + wpa_s, WLAN_REASON_DEAUTH_LEAVING); + } wpas_dpp_chirp_stop(wpa_s); wpa_s->dpp_allowed_roles = DPP_CAPAB_ENROLLEE; wpa_s->dpp_qr_mutual = 0;