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 the `Stop()` method to behave differently based on a `StopMode` input. If called from `DNSServiceProcessResult()` call where we get a `kDNSServiceErr_ServiceNotRunning` error, we need to restart the `Publisher` and should immediately de-allocate all `ServiceRefs`, including `mHostsRef`. Otherwise, during a `kNormalStop`, we first clear the `m{Host/Service}Registrations` lists before de-allocating the `mHostsRef`. This ensures that `mHostsRef` and all its related child `DNSRecordRef`s remain valid when `DnssdHostRegistration` destructor is called, which accesses and uses them 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