Put back wifi IPv6 workaround (#21274)

This commit is contained in:
s-hadinger 2024-04-25 10:28:42 +02:00 committed by GitHub
parent 469492a41a
commit 2a35f325b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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:
{