From 2a35f325b8503e1b4ef4fb6c08a72a8b401eac18 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:28:42 +0200 Subject: [PATCH] Put back wifi IPv6 workaround (#21274) --- CHANGELOG.md | 1 + tasmota/tasmota_support/support_wifi.ino | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63bea0fb9..e74ad417f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file. - IPv6 support in safeboot - LVGL fix memory allocation of flush buffers - Berry `web_add_handler` called before `Webserver` is initialized +- Put back wifi IPv6 workaround ### Removed - LVGL disabled vector graphics diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index e623a9f07..6e5b34419 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -1469,6 +1469,18 @@ void WifiEvents(arduino_event_t *event) { IPv6isLocal(addr) ? PSTR("Local") : PSTR("Global"), addr.toString(true).c_str()); } break; + + case ARDUINO_EVENT_WIFI_STA_CONNECTED: + // workaround for the race condition in LWIP, see https://github.com/espressif/arduino-esp32/pull/9016#discussion_r1451774885 + { + uint32_t i = 5; // try 5 times only + while (esp_netif_create_ip6_linklocal(get_esp_interface_netif(ESP_IF_WIFI_STA)) != ESP_OK) { + delay(1); + if (i-- == 0) { + break; + } + } + } #endif // USE_IPV6 case ARDUINO_EVENT_WIFI_STA_GOT_IP: {