Skip to content

Commit 7ea95ec

Browse files
authored
Show network interface priority in 'Status 5' debug logging (#23302)
1 parent 8921a42 commit 7ea95ec

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
1212
- Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM`
1313
- PZEM_AC device address in JSON and GUI (#23268)
1414
- Filesystem command ``UfsList[2]``
15+
- Show network interface priority in `Status 5` debug logging
1516

1617
### Breaking Changed
1718
- HASPmota added `y2_min` and `y2_max` to control the second series of `chart` (#23287)

tasmota/tasmota_support/support_wifi.ino

+6-3
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,18 @@ String DNSGetIPStr(uint32_t idx)
648648

649649
//
650650
#include "lwip/dns.h"
651+
#include "esp_netif_net_stack.h"
651652
void WifiDumpAddressesIPv6(void)
652653
{
653654
for (netif* intf = netif_list; intf != nullptr; intf = intf->next) {
654-
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());
655+
esp_netif_t *esp_netif = esp_netif_get_handle_from_netif_impl(intf);
656+
int32_t route_prio = esp_netif ? esp_netif_get_route_prio(esp_netif) : -1;
657+
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);
655658
for (uint32_t i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
656659
if (!ip_addr_isany_val(intf->ip6_addr[i]))
657-
AddLog(LOG_LEVEL_DEBUG, "IP : '%c%c%i' IPv6 %s %s", intf->name[0], intf->name[1], intf->num,
660+
AddLog(LOG_LEVEL_DEBUG, "IP : '%c%c%i' IPv6 %s %s (%i)", intf->name[0], intf->name[1], intf->num,
658661
IPAddress(&intf->ip6_addr[i]).toString(true).c_str(),
659-
ip_addr_islinklocal(&intf->ip6_addr[i]) ? "local" : "");
662+
ip_addr_islinklocal(&intf->ip6_addr[i]) ? "local" : "", route_prio);
660663
}
661664
}
662665
AddLog(LOG_LEVEL_DEBUG, "IP : DNS: %s %s", IPAddress(dns_getserver(0)).toString().c_str(), IPAddress(dns_getserver(1)).toString(true).c_str());

0 commit comments

Comments
 (0)