]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Update wpa_supplicant configuration file after provisioning
authorJouni Malinen <j@w1.fi>
Sat, 9 Mar 2019 14:21:54 +0000 (16:21 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 9 Mar 2019 14:21:54 +0000 (16:21 +0200)
WPS was already doing this if update_config=1 was set and DPP should be
consistent with that behavior. Update the configuration file if
update_config=1 and dpp_config_processing is set to 1 or 2.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/dpp_supplicant.c

index b6a667173a1fe4e0ee2b1fad9b73c838e45fe7f4..74f71701f3917bd1f553c7dddb8dfafccdc11b34 100644 (file)
@@ -1249,11 +1249,19 @@ static void wpas_dpp_process_config(struct wpa_supplicant *wpa_s,
                return;
 
        wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_NETWORK_ID "%d", ssid->id);
+       if (wpa_s->conf->dpp_config_processing == 2)
+               ssid->disabled = 0;
+
+#ifndef CONFIG_NO_CONFIG_WRITE
+       if (wpa_s->conf->update_config &&
+           wpa_config_write(wpa_s->confname, wpa_s->conf))
+               wpa_printf(MSG_DEBUG, "DPP: Failed to update configuration");
+#endif /* CONFIG_NO_CONFIG_WRITE */
+
        if (wpa_s->conf->dpp_config_processing < 2)
                return;
 
        wpa_printf(MSG_DEBUG, "DPP: Trying to connect to the new network");
-       ssid->disabled = 0;
        wpa_s->disconnected = 0;
        wpa_s->reassociate = 1;
        wpa_s->scan_runs = 0;