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.
This commit is contained in:
SASANO Takayoshi 2020-10-06 06:27:18 +09:00
parent 879b426308
commit f2c399308b

View file

@ -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++;
}
}