Skip to content

Commit

Permalink
fix(net): Do not use netif_index_to_name
Browse files Browse the repository at this point in the history
Causes error on recent IDF builds
  • Loading branch information
me-no-dev committed Oct 22, 2024
1 parent 8ac076c commit 20a28b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
14 changes: 7 additions & 7 deletions cores/esp32/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ size_t IPAddress::printTo(Print &p, bool includeZone) const {
n += p.print(':');
}
}
// add a zone if zone-id is non-zero
if (_zone > 0 && includeZone) {
n += p.print('%');
char if_name[NETIF_NAMESIZE];
netif_index_to_name(_zone, if_name);
n += p.print(if_name);
}
// add a zone if zone-id is non-zero (causes exception on recent IDF builds)
// if (_zone > 0 && includeZone) {
// n += p.print('%');
// char if_name[NETIF_NAMESIZE];
// netif_index_to_name(_zone, if_name);
// n += p.print(if_name);
// }
return n;
}

Expand Down
8 changes: 2 additions & 6 deletions libraries/Network/src/NetworkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,10 @@ void NetworkInterface::_onIpEvent(int32_t event_id, void *event_data) {
setStatusBits(ESP_NETIF_HAS_LOCAL_IP6_BIT);
}
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
char if_name[NETIF_NAMESIZE] = {
0,
};
netif_index_to_name(event->ip6_info.ip.zone, if_name);
static const char *addr_types[] = {"UNKNOWN", "GLOBAL", "LINK_LOCAL", "SITE_LOCAL", "UNIQUE_LOCAL", "IPV4_MAPPED_IPV6"};
log_v(
"IF %s Got IPv6: Interface: %d, IP Index: %d, Type: %s, Zone: %d (%s), Address: " IPV6STR, desc(), _interface_id, event->ip_index, addr_types[addr_type],
event->ip6_info.ip.zone, if_name, IPV62STR(event->ip6_info.ip)
"IF %s Got IPv6: Interface: %d, IP Index: %d, Type: %s, Zone: %d, Address: " IPV6STR, desc(), _interface_id, event->ip_index, addr_types[addr_type],
event->ip6_info.ip.zone, IPV62STR(event->ip6_info.ip)
);
#endif
memcpy(&arduino_event.event_info.got_ip6, event_data, sizeof(ip_event_got_ip6_t));
Expand Down

0 comments on commit 20a28b5

Please sign in to comment.