From 2386317a38e2d1f4d20ee9233d38ff0c9ad18cb5 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 4 Nov 2022 14:57:20 -0700 Subject: [PATCH] [linux] Fix the device failed to reconnect wifi after power cycle (#23504) * [linux] Fix the device failed to reconnect wifi after power cycle * Add return to prevent indent in the following code --- src/platform/Linux/ConnectivityManagerImpl.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index ca7251d72a28cc..41b8af50158bd9 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -1060,7 +1060,24 @@ void ConnectivityManagerImpl::_ConnectWiFiNetworkAsyncCallback(GObject * source_ } mpConnectCallback = nullptr; }); + + return; + } + + GError * gerror = nullptr; + + result = wpa_fi_w1_wpa_supplicant1_interface_call_save_config_sync(mWpaSupplicant.iface, nullptr, &gerror); + if (result) + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: save config succeeded!"); } + else + { + ChipLogProgress(DeviceLayer, "wpa_supplicant: failed to save config: %s", gerror ? gerror->message : "unknown error"); + } + + if (gerror != nullptr) + g_error_free(gerror); } }