]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP2: Remove reconfigured network
authorJouni Malinen <jouni@codeaurora.org>
Sun, 10 May 2020 21:43:07 +0000 (00:43 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 11 May 2020 14:26:11 +0000 (17:26 +0300)
Do not leave behind the old network profile when reconfiguration is
completed successfully.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/dpp_supplicant.c

index ae93d59fdb4404c142f0d7904a388430c72d6964..b8c1716ce59e04a65041360db8ba1f829d507fc4 100644 (file)
@@ -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;