From f2c399308b58a8b1757075c4381ca79b1cd3ac5e Mon Sep 17 00:00:00 2001 From: SASANO Takayoshi Date: Tue, 6 Oct 2020 06:27:18 +0900 Subject: [PATCH] CNetworkInfo::getNetworkInterface display IP address is limited to IPv4 Displayed IP address is now IPv4 only due to referring IPv4 routing table to get default route. This feature is used by hotspots which have small LCD or OLED display to show IP address to remote login. No effects to connect other reflectors. If completely disabled IPv4 world will come, the code need to be revised. --- NetworkInfo.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NetworkInfo.cpp b/NetworkInfo.cpp index e4e57f8ea..7df2d3c87 100644 --- a/NetworkInfo.cpp +++ b/NetworkInfo.cpp @@ -172,12 +172,13 @@ void CNetworkInfo::getNetworkInterface(unsigned char* info) if (family == AF_INET) { ::sprintf(interfacelist[ifnr], "%s:%s", ifa->ifa_name, host); LogInfo(" IPv4: %s", interfacelist[ifnr]); + ifnr++; } else { ::sprintf(interfacelist[ifnr], "%s:%s", ifa->ifa_name, host); LogInfo(" IPv6: %s", interfacelist[ifnr]); + // due to default routing is for IPv4, other + // protocols are not candidate to display. } - - ifnr++; } }