mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 20:56:35 +00:00
Fix IPv4 DNS resolution when IPv6 is enabled
This commit is contained in:
parent
958c41a9f6
commit
1bdb542e50
@ -893,6 +893,9 @@ bool WifiHostByName(const char* aHostname, IPAddress& aResult) {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// DnsClient can't do one-shot mDNS queries so use WiFi.hostByName() for *.local
|
// DnsClient can't do one-shot mDNS queries so use WiFi.hostByName() for *.local
|
||||||
|
#ifdef USE_IPV6
|
||||||
|
aResult.setV4(); // force IPv4 result for now, until DNS is updated to IPv6
|
||||||
|
#endif
|
||||||
size_t hostname_len = strlen(aHostname);
|
size_t hostname_len = strlen(aHostname);
|
||||||
if (strstr_P(aHostname, PSTR(".local")) == &aHostname[hostname_len] - 6) {
|
if (strstr_P(aHostname, PSTR(".local")) == &aHostname[hostname_len] - 6) {
|
||||||
if (WiFi.hostByName(aHostname, aResult)) {
|
if (WiFi.hostByName(aHostname, aResult)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user