From f429d41a32b03815d7cf1e1809e95116e2241256 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Tue, 13 Dec 2022 09:31:43 +0100 Subject: [PATCH] Fix IPv6 compilation for ESP8266 (#17374) --- tasmota/tasmota_support/support_wifi.ino | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index 5088ab81b..cc03a8fde 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -517,8 +517,14 @@ void WifiDumpAddressesIPv6(void) // Check to see if we have any routable IP address bool WifiHasIP(void) { #ifdef USE_IPV6 +#ifdef ESP32 return !WiFi.localIP().isAny(); +#else // ESP32 + const ip_addr_t &ipaddr = (ip_addr_t)WiFi.localIP(); + return !ip_addr_isany_val(ipaddr); +#endif // ESP32 #else + // IPv4 only return (uint32_t)WiFi.localIP() != 0; #endif // USE_IPV6 } @@ -526,12 +532,13 @@ bool WifiHasIP(void) { void WifiCheckIp(void) { #ifdef USE_IPV6 if (WL_CONNECTED == WiFi.status()) { +#ifdef ESP32 if (!Wifi.ipv6_local_link_called) { WiFi.enableIpV6(); Wifi.ipv6_local_link_called = true; // AddLog(LOG_LEVEL_DEBUG, PSTR("WIF: calling enableIpV6")); } - +#endif } #endif // USE_IPV6