-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[darwin] Use DNSServiceReconfirmRecord for A and AAAA records to miti… #23067
[darwin] Use DNSServiceReconfirmRecord for A and AAAA records to miti… #23067
Conversation
8fa79a7
to
e17af4c
Compare
Thanks for this answer and the additional details about the intended use of the API. In this context, "stale records" refers to The source of the reboot can be because of a hard reset (e.g power loss), or a soft reset (FW update) with the node not properly clearing up the mdns records. Since a single "best" IP is tried when establishing a session over UDP (PASE/CASE) it may fails if the "best" IP is one of the stale entry. Also, even if all returned IPs are tried, the session establishment will be slow reliable UDP is used and we will need to wait for 5 messages failures before attempting to connect to the next one (the time between retries varies depending on some values emitted by the node in the mdns advertisement). I have updated this PR such that |
@andy31415 I am re-requesting review since the code has changed a lot since your last review. |
e17af4c
to
82e8f4d
Compare
PR #23067: Size comparison from d16182f to 82e8f4d Increases (47 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (6 builds for cc13x2_26x2)
Full report (47 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
82e8f4d
to
b3b42e1
Compare
PR #23067: Size comparison from 0d6c60f to b3b42e1 Increases (38 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (6 builds for cc13x2_26x2)
Full report (38 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
b3b42e1
to
b1bb9d2
Compare
…ecting to them ends with a CHIP_ERROR_TIMEOUT
b1bb9d2
to
2dab08a
Compare
PR #23067: Size comparison from 9c3feda to 2dab08a Increases (48 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, nrfconnect, psoc6, qpg, telink)
Decreases (6 builds for cc13x2_26x2)
Full report (49 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
@@ -273,5 +273,10 @@ CHIP_ERROR ChipDnssdResolve(DnssdService * service, chip::Inet::InterfaceId inte | |||
return error; | |||
} | |||
|
|||
CHIP_ERROR ChipDnssdReconfirmRecord(const char * hostname, chip::Inet::IPAddress address, chip::Inet::InterfaceId interface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having most platforms being CHIP_ERROR_NOT_IMPLEMENTED seems painful. How about ifdefing in this case and only calling it for apple/darwin?
@@ -245,5 +245,15 @@ CHIP_ERROR ChipDnssdStopBrowse(intptr_t browseIdentifier); | |||
CHIP_ERROR ChipDnssdResolve(DnssdService * browseResult, chip::Inet::InterfaceId interface, DnssdResolveCallback callback, | |||
void * context); | |||
|
|||
/** | |||
* This function asks the mdns daemon to asynchronously reconfirm an address that appears to be out of date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whad does 'reconfirm' mean?
When reading the comment, this reads to me like reading the method name. It does say 'async' so maybe the name should be AsyncReconfirmRecord
(wondering why we have ChipDnssd prefix in a namespace chip::Dnssd ... that is stuttering).
I think this should explain what reconfirmation is and when this method is to be used and how.
project-chip#23067) * [Dnssd] Add ReconfirmRecord method to verify address that appears to be out of date * [SetUpCodePairer] Ask Dnssd to reconfirm discovered addresses if connecting to them ends with a CHIP_ERROR_TIMEOUT
project-chip#23067) * [Dnssd] Add ReconfirmRecord method to verify address that appears to be out of date * [SetUpCodePairer] Ask Dnssd to reconfirm discovered addresses if connecting to them ends with a CHIP_ERROR_TIMEOUT
…at fixes DNS-SD browsing Add an API to stop a DNS-SD browse operation. (project-chip#22823) * Add an API to stop a DNS-SD browse operation. Most backends don't implement this yet. Darwin does, and no longer stops Browse operations itself. Fixes project-chip#19194 May provide a way toward fixing project-chip#13275 * Address review comments. * Address more review comments. [darwin] Use DNSServiceReconfirmRecord for A and AAAA records to miti… (project-chip#23067) * [Dnssd] Add ReconfirmRecord method to verify address that appears to be out of date * [SetUpCodePairer] Ask Dnssd to reconfirm discovered addresses if connecting to them ends with a CHIP_ERROR_TIMEOUT Fix Logging When Trying to Log Nullptr To Strings (project-chip#23604) This PR attempts to identify all cases where %s specifiers in the logging APIs (ChipLogError(), ChipLogProgress(), ChipLogDetail()) don't have a guaranteed non-null string parameter. In all identified cases the issue is fixed using StringOrNullMarker() helper method to guarantee it doesn't happen. Use the "right" byte-swapping function for port in Darwin DnssdImpl. (project-chip#23894) The incoming port is in host byte order and we are converting to network byte order, so should use htons (which happens to do the same thing as ntohs, so no behavior change). Co-authored-by: Andrei Litvin <[email protected]> Add a way for Resolver consumers to cancel operational resolve attempts. (project-chip#24010) * Add a way for Resolver consumers to cancel operational resolve attempts. Adds a way for consumers to notify Resolver when they no longer care about an operational resolve, so a Resolver implementation can keep track of how many consumers are interested and stop work as desired if no one is interested. Fixes project-chip#23881 * Address review comments. * Address review comments. Make sure we stop resolves triggered by a browse when the browse stops on Darwin. (project-chip#24733) * Make sure we stop resolves triggered by a browse when the browse stops on Darwin. Without this change, if there is a PTR record that matches whatever we are browsing but no corresponding SRV record, we would end up leaking a resolve forever. Tested by modifying minimal mdns SrvResponder::AddAllResponses to no-op instead of actually adding any responses, then trying to commission the device running the modified minimal mdns. Without this change, when the browse stops the resolves it triggered keep going. With this change, termination of the browse also terminates the resolves. Fixes project-chip#24074 * Also avoid leaking ResolveContext instances. * Fix handling of multiple interfaces. * Address review comment. Improve discovery logging on Darwin. (project-chip#24846) 1) Use progress, not detail, logging, because detail logging is not actually persisted in system logs. 2) Add logging to a few functions that were missing it. Remove the address type argument from ResolveNodeId. (project-chip#24006) All consumers were passing kAny in practice, and some of the backends (e.g. minimal mdns) had no capability to filter by type anyway.
project-chip#23067) * [Dnssd] Add ReconfirmRecord method to verify address that appears to be out of date * [SetUpCodePairer] Ask Dnssd to reconfirm discovered addresses if connecting to them ends with a CHIP_ERROR_TIMEOUT
project-chip#23067) * [Dnssd] Add ReconfirmRecord method to verify address that appears to be out of date * [SetUpCodePairer] Ask Dnssd to reconfirm discovered addresses if connecting to them ends with a CHIP_ERROR_TIMEOUT
project-chip#23067) * [Dnssd] Add ReconfirmRecord method to verify address that appears to be out of date * [SetUpCodePairer] Ask Dnssd to reconfirm discovered addresses if connecting to them ends with a CHIP_ERROR_TIMEOUT
project-chip#23067) * [Dnssd] Add ReconfirmRecord method to verify address that appears to be out of date * [SetUpCodePairer] Ask Dnssd to reconfirm discovered addresses if connecting to them ends with a CHIP_ERROR_TIMEOUT
…gate stale cache issues
Problem
Sometimes there are stale DNS A and AAAA records. This patch instruct the daemon to verify the validity of such records. It does not prevent stale records to be used but reduce their lifetime and may help for subsequent pairing attempts.