From 182f6ae9059c7b5b8eeafb12cdcda824a6b50015 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 11 May 2020 00:43:07 +0300 Subject: [PATCH] DPP2: Remove reconfigured network Do not leave behind the old network profile when reconfiguration is completed successfully. Signed-off-by: Jouni Malinen --- wpa_supplicant/dpp_supplicant.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c index ae93d59fd..b8c1716ce 100644 --- a/wpa_supplicant/dpp_supplicant.c +++ b/wpa_supplicant/dpp_supplicant.c @@ -1257,6 +1257,20 @@ static int wpas_dpp_process_config(struct wpa_supplicant *wpa_s, static void wpas_dpp_post_process_config(struct wpa_supplicant *wpa_s, struct dpp_authentication *auth) { +#ifdef CONFIG_DPP2 + if (auth->reconfig && wpa_s->dpp_reconfig_ssid && + wpa_config_get_network(wpa_s->conf, wpa_s->dpp_reconfig_ssid_id) == + wpa_s->dpp_reconfig_ssid) { + wpa_printf(MSG_DEBUG, + "DPP: Remove reconfigured network profile"); + wpas_notify_network_removed(wpa_s, wpa_s->dpp_reconfig_ssid); + wpa_config_remove_network(wpa_s->conf, + wpa_s->dpp_reconfig_ssid_id); + wpa_s->dpp_reconfig_ssid = NULL; + wpa_s->dpp_reconfig_ssid_id = -1; + } +#endif /* CONFIG_DPP2 */ + if (wpa_s->conf->dpp_config_processing < 2) return;