diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index abbc4647ff3805..3369f8c00b3b3b 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -420,8 +420,13 @@ void DiscoveryImplPlatform::HandleDnssdInit(void * context, CHIP_ERROR initError void DiscoveryImplPlatform::HandleDnssdError(void * context, CHIP_ERROR error) { + DiscoveryImplPlatform * publisher = static_cast(context); + if (error == CHIP_ERROR_FORCED_RESET) { + // Restore dnssd state before restart, also needs to call ChipDnssdShutdown() + publisher->Shutdown(); + DeviceLayer::ChipDeviceEvent event; event.Type = DeviceLayer::DeviceEventType::kDnssdRestartNeeded; error = DeviceLayer::PlatformMgr().PostEvent(&event);