From: Jouni Malinen Date: Thu, 13 Aug 2020 14:05:49 +0000 (+0300) Subject: DPP2: Disconnect before starting reconfiguration X-Git-Tag: hostap_2_10~1017 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3adc1c623e8ebf44b5ad0ff0aac279686b030e3e;p=thirdparty%2Fhostap.git 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 --- 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;