[srp-server] fix fast-start mode disruption when device role changes (#11330)

When in fast-start mode, the SRP server will be disabled and then
immediately enabled again if the device transfers from Child to Router.
This commit fixes this issue by also matching the MLE-ID with the SRP
server address in the Network Data.
This commit is contained in:
Kangping
2025-03-10 08:54:38 -07:00
committed by GitHub
parent 555454c973
commit 1dd7f11ae7
+2 -1
View File
@@ -325,7 +325,8 @@ bool Server::NetDataContainsOtherSrpServers(void) const
while (Get<NetworkData::Service::Manager>().GetNextDnsSrpUnicastInfo(
iterator, NetworkData::Service::kAddrInServerData, unicastInfo) == kErrorNone)
{
if (!Get<Mle::Mle>().HasRloc16(unicastInfo.mRloc16))
if (!Get<Mle::Mle>().HasRloc16(unicastInfo.mRloc16) &&
Get<Mle::Mle>().GetMeshLocalEid() != unicastInfo.mSockAddr.GetAddress())
{
contains = true;
ExitNow();