-
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
[BUG] ESP32 sends message to the unique local address before it has route to the address and is able to reach the ULA #25570
Comments
This is odd. After #25173 I would expect that kDnssdInitialized would not happen until we have an ipv6 address, for minimal mdns, which is what that log is using. Is that logic failing somehow? @wqx6 Could you check what's happening in the interface iteration there, if you can reproduce this every time? |
So on ESP32 it looks like InitOTARequestorHandler is called off a timer via InitOTARequestor is called from any of the following cases:
None of that is waiting for |
@bzbarsky-apple #25563 will not fix this issue, I met this issue even if I apply this patch. #25563 only fixes the issue the device might resolve no address. But my issue is that the device has resolve some IPv6 addresses, but sends the message to the wrong IPv6 address which is unreachable for the device at that time. Can we make the link local address have higher score than the ULA in https://github.com/project-chip/connectedhomeip/blob/master/src/lib/dnssd/IPAddressSorter.h#L46 |
I think other platforms might have the same issue, because it might send message to the unique local address before it has route to the address and is able to reach the ULA. |
Just to be clear, that's not what the attached log is showing, right? I would be somewhat curious to see a log showing the failure after #25563 is applied.
I clearly think so, since the Apple case does this. But there were objections to changing it in general, which is how we ended up with the ifdef.... |
This is what the attached log shows.
The ULA
A simple way to see the log after #25563
|
Right, and that's showing the message being sent before |
Before the error, the device gets a link local IPv6 address, which triggers the DnssdInitialized event. |
Ah, I see, there are two I wonder whether we can somehow do the prioritization based on what sorts of addresses we have on the interface that the resolve was received on, so that we make sure to only use LL addresses if we ourselves only have an LL address, no matter what else we do with the priority. Past that, @andy31415 had opinions on this, but I think he's on vacation right now... |
@andy31415 Can we make some changes to the IP address score? |
We could add more logic into https://github.com/project-chip/connectedhomeip/blob/master/src/lib/dnssd/IPAddressSorter.cpp#L44 (which is called from https://github.com/project-chip/connectedhomeip/blob/master/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp#L120). Overall the initial thought was that ULA are more likely to be "correct" compared to link local, however if we need to have more heuristics we could add/change thing with a comment explaining. I am all for doing what works best in more cases. |
Close as #27981 merged |
Reproduction steps
In non-apple devices, the unique local address has higher score than the link local address. But the score might cause an issue. If the OTA Requestor applies the OTA image and reboot, after rebooting, it will send a NotifyUpdateApplied command to the Provider (Assuming the command is sent when the event
kDnssdInitialized
is post).If the Provider has an ULA , and the requestor only gets its link local address (The requestor might not receive the RA message and add the ULA when it wants to send the command), the Provider is unreachable for the Requestor.
Here is my log.
ipaddr_resolve_issue.log
In the log, the device wants to send message to addr [FDDE:AD00:BEEF:DAD0:A276:4EFF:FE68:BF00] before it gets an IP address [fdde:ad00:beef:dad0:f612:faff:fe03:89dc].
Bug prevalence
Whenever I do this
GitHub hash of the SDK that was being used
536a0d9
Platform
esp32
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: