mirror of https://github.com/arendst/Tasmota.git
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
|
||||
// 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);
|
||||
if (strstr_P(aHostname, PSTR(".local")) == &aHostname[hostname_len] - 6) {
|
||||
if (WiFi.hostByName(aHostname, aResult)) {
|
||||
|
|
Loading…
Reference in New Issue