Show network interface priority in 'Status 5' debug logging (#23302)

This commit is contained in:
s-hadinger 2025-04-15 13:21:14 +02:00 committed by GitHub
parent 8921a42f79
commit 7ea95ec6b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM`
- PZEM_AC device address in JSON and GUI (#23268)
- Filesystem command ``UfsList[2]``
- Show network interface priority in `Status 5` debug logging
### Breaking Changed
- HASPmota added `y2_min` and `y2_max` to control the second series of `chart` (#23287)

View File

@ -648,15 +648,18 @@ String DNSGetIPStr(uint32_t idx)
//
#include "lwip/dns.h"
#include "esp_netif_net_stack.h"
void WifiDumpAddressesIPv6(void)
{
for (netif* intf = netif_list; intf != nullptr; intf = intf->next) {
if (!ip_addr_isany_val(intf->ip_addr)) AddLog(LOG_LEVEL_DEBUG, "WIF: '%c%c%i' IPv4 %s", intf->name[0], intf->name[1], intf->num, IPAddress(&intf->ip_addr).toString(true).c_str());
esp_netif_t *esp_netif = esp_netif_get_handle_from_netif_impl(intf);
int32_t route_prio = esp_netif ? esp_netif_get_route_prio(esp_netif) : -1;
if (!ip_addr_isany_val(intf->ip_addr)) AddLog(LOG_LEVEL_DEBUG, "WIF: '%c%c%i' IPv4 %s (%i)", intf->name[0], intf->name[1], intf->num, IPAddress(&intf->ip_addr).toString(true).c_str(), route_prio);
for (uint32_t i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
if (!ip_addr_isany_val(intf->ip6_addr[i]))
AddLog(LOG_LEVEL_DEBUG, "IP : '%c%c%i' IPv6 %s %s", intf->name[0], intf->name[1], intf->num,
AddLog(LOG_LEVEL_DEBUG, "IP : '%c%c%i' IPv6 %s %s (%i)", intf->name[0], intf->name[1], intf->num,
IPAddress(&intf->ip6_addr[i]).toString(true).c_str(),
ip_addr_islinklocal(&intf->ip6_addr[i]) ? "local" : "");
ip_addr_islinklocal(&intf->ip6_addr[i]) ? "local" : "", route_prio);
}
}
AddLog(LOG_LEVEL_DEBUG, "IP : DNS: %s %s", IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString(true).c_str());