mirror of
https://github.com/espressif/openthread.git
synced 2026-08-01 00:27:47 +00:00
[srp-server] ensure to clear mHasRegisteredAnyService on server stop (#6763)
This commit updates `Srp::Server` to clear `mHasRegisteredAnyService` when server is stopped and all the hosts and services are deleted. This boolean flag is used to save the port number in non-volatile settings so that we can ensure to pick a different port number the next time the server starts. This change addresses an issue where the port number may not be saved and therefore not changed if the server is stopped and restarted two times in a row.
This commit is contained in:
committed by
Jonathan Hui
parent
b11d0d2205
commit
7799bae4ef
@@ -487,6 +487,7 @@ void Server::Stop(void)
|
||||
|
||||
otLogInfoSrp("[server] stop listening on %hu", mSocket.GetSockName().mPort);
|
||||
IgnoreError(mSocket.Close());
|
||||
mHasRegisteredAnyService = false;
|
||||
|
||||
exit:
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user