fix(net): Do not use netif_index_to_name
Causes error on recent IDF builds
This commit is contained in:
parent
8ac076c44c
commit
20a28b58bc
2 changed files with 9 additions and 13 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue