Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unsolicited announcements with minimal mDNS
As of 97d9f7e ("Address 9154 and CM/AC DNS-SD convergence (project-chip#9348)") operational discovery during chip-tool's commissioning flow typically fails with minimal mDNS. This occurs because this change unintentionally broke the logic to send unsolicited mDNS announcements as required by RFC 6762. During commissioning, the initial mDNS query to resolve the operational service on the network is generally sent before the device is able to join the network. The is perfectly fine because RFC 6762 accounts for this case and requires devices joining the network to advertise all of their records. These unsolicited responses provide the IP address and allow the final commissioning steps to execute. The minimal mDNS implementation sends its unsolicited announcements in Start() and not at any other time. In the above change, we started calling StopPublishDevice() immediately prior to (re-)starting the server, leaving no records to announce. The records are added immediately afterwards, but currently adding records does not trigger additional announcements. Thus, a response never arrives and commissioning times out. Fix this by adding an announcement after the records are added. Unfortunately this will quite spammy since we announce everything and advertise is called several times in a row. What should happen is announcements only happen with new or updated records, or when new interfaces are enabled. (Note that this problem is greatly exacerbated by the lack of retransmissions of queries, which is being addressed in project-chip#9900).
- Loading branch information