From 7ea95ec6b292a81aeb4814e4cffc1df68b5e7284 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Tue, 15 Apr 2025 13:21:14 +0200 Subject: [PATCH] Show network interface priority in 'Status 5' debug logging (#23302) --- CHANGELOG.md | 1 + tasmota/tasmota_support/support_wifi.ino | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04c1459c5..ddc89392b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index 0c0c6f692..e4942679c 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -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());