forked from openthread/ot-br-posix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mdns-mdnssd] fix access of freed
mHostsRef
in Stop()
This commit updates `Stop()` method to behave differently based on an `StopMode` input. If from `DNSServiceProcessResult()` call from main run loop, we get a `kDNSServiceErr_ServiceNotRunning` error, we need to restart the `Publisher` and we should immediately de-allocate all `ServiceRef` including `mHostsRef`. Otherwise, during a `kNormalStop`, we first clear the `m{Host/Service}Registrations` list before de-allocating the `mHostsref`. This ensures that `mHostsRef` and all its child `DNSRecordRef`s remain valid when the destructor of `DnssdHostRegistration` is called which accesses and uses these to update the published AAAA (IPv6 Address) records.
- Loading branch information
Showing
2 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters