[dns] signal an error immediately when no upstream DNS server available (#11480)

Currently, if the platform has no upstream DNS server configured,
upstream DNS query will eventually time out. This can lead to delays
in responding to the DNS client.

The new otPlatDnsIsUpstreamQueryAvailable API provides a mechanism for
the platform to proactively signal the unavailability of upstream DNS.
This commit is contained in:
Yang Song
2025-05-20 14:50:18 -07:00
committed by GitHub
parent 4f692464d5
commit 1f54a868cf
7 changed files with 64 additions and 1 deletions
+7
View File
@@ -700,6 +700,13 @@ otError otPlatUdpLeaveMulticastGroup(otUdpSocket *aUdpSocket,
#endif // OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE
#if OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE
bool otPlatDnsIsUpstreamQueryAvailable(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
return true;
}
void otPlatDnsStartUpstreamQuery(otInstance *aInstance, otPlatDnsUpstreamQuery *aTxn, const otMessage *aQuery)
{
OT_UNUSED_VARIABLE(aInstance);