diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.cpp b/src/platform/Zephyr/ConfigurationManagerImpl.cpp index 15017bb800..e68d4153ee 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.cpp +++ b/src/platform/Zephyr/ConfigurationManagerImpl.cpp @@ -42,7 +42,7 @@ #ifdef CONFIG_NET_L2_OPENTHREAD #include -#endif +#endif namespace chip { namespace DeviceLayer { @@ -181,6 +181,12 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) { ChipLogProgress(DeviceLayer, "Performing factory reset"); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT + ThreadStackMgr().WaitOnSrpClearAllComplete(); + ThreadStackMgr().ClearAllSrpHostAndServices(); + ThreadStackMgr().NotifySrpClearAllComplete(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT + // Lock the Thread stack to avoid unwanted interaction with settings NVS during factory reset. #ifdef CONFIG_NET_L2_OPENTHREAD ThreadStackMgr().LockThreadStack();