Skip to content

Commit

Permalink
fix compile error when lwip ipv6 address number > 8
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 committed Aug 21, 2024
1 parent 97dbbb3 commit 7511720
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/thread-br-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/platform/ESP32/DiagnosticDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 7511720

Please sign in to comment.