From 75117202b59a3fa95ca93bf4e01ceef26d5e9c8e Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Wed, 21 Aug 2024 14:24:55 +0800 Subject: [PATCH] fix compile error when lwip ipv6 address number > 8 --- examples/thread-br-app/esp32/sdkconfig.defaults | 2 +- src/platform/ESP32/DiagnosticDataProviderImpl.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/thread-br-app/esp32/sdkconfig.defaults b/examples/thread-br-app/esp32/sdkconfig.defaults index 20712bf96d5ae1..498081c21f8c47 100644 --- a/examples/thread-br-app/esp32/sdkconfig.defaults +++ b/examples/thread-br-app/esp32/sdkconfig.defaults @@ -41,7 +41,7 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # LWIP CONFIG_LWIP_IPV6_FORWARD=y CONFIG_LWIP_IPV6_AUTOCONFIG=y -CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 +CONFIG_LWIP_IPV6_NUM_ADDRESSES=12 CONFIG_LWIP_MULTICAST_PING=y CONFIG_LWIP_NETIF_STATUS_CALLBACK=y CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT=y diff --git a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp index 33de4d372199ee..fc2992f20d3fc9 100644 --- a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp @@ -206,7 +206,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** esp_netif_t * netif = esp_netif_next(NULL); NetworkInterface * head = NULL; uint8_t ipv6_addr_count = 0; - esp_ip6_addr_t ip6_addr[kMaxIPv6AddrCount]; + esp_ip6_addr_t ip6_addr[LWIP_IPV6_NUM_ADDRESSES]; if (netif == NULL) { ChipLogError(DeviceLayer, "Failed to get network interfaces"); @@ -253,7 +253,6 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** #endif // !defined(CONFIG_DISABLE_IPV4) static_assert(kMaxIPv6AddrCount <= UINT8_MAX, "Count might not fit in ipv6_addr_count"); - static_assert(ArraySize(ip6_addr) >= LWIP_IPV6_NUM_ADDRESSES, "Not enough space for our addresses."); auto addr_count = esp_netif_get_all_ip6(ifa, ip6_addr); if (addr_count < 0) {