From 4c45ee8e0e550e4ff78e0799f86d9a38bfadbd28 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 27 Sep 2024 10:15:47 -0700 Subject: [PATCH] [dns-client] fix handling of IPv4 resolve failure (#10766) This commit fixes an issue in `Client::ReplaceWithIp4Query()` where an IPv6 address resolution query failure could lead to an incorrect IPv4 query being sent. The incorrect query type was being checked in this method, causing `ResolveIp4Address()` to keep sending queries. --- src/core/net/dns_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/net/dns_client.cpp b/src/core/net/dns_client.cpp index 82b89d697..bdf730296 100644 --- a/src/core/net/dns_client.cpp +++ b/src/core/net/dns_client.cpp @@ -1563,7 +1563,7 @@ Error Client::ReplaceWithIp4Query(Query &aQuery) info.ReadFrom(aQuery); - VerifyOrExit(info.mQueryType == kIp4AddressQuery); + VerifyOrExit(info.mQueryType == kIp6AddressQuery); VerifyOrExit(info.mConfig.GetNat64Mode() == QueryConfig::kNat64Allow); // We send a new query for IPv4 address resolution