Merge pull request #1145 from kiwix/ci_fix

Fix broken CI on Linux (aarch64, focal)
This commit is contained in:
Kelson 2024-10-03 16:48:21 +00:00 committed by GitHub
commit 4a1498d8df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -89,7 +89,8 @@ bool ipAvailable(const std::string addr)
{
auto interfaces = kiwix::getNetworkInterfacesIPv4Or6();
for (const auto& [_, interfaceIps] : interfaces) {
for (const auto& kv : interfaces) {
const auto& interfaceIps = kv.second;
if ((interfaceIps.addr == addr) || (interfaceIps.addr6 == addr)) {
return true;
}

View File

@ -231,7 +231,8 @@ IpAddress getBestPublicIps() {
#endif
const char* const v4prefixes[] = { "192.168", "172.16", "10.0", "169.254" };
for (const auto& prefix : v4prefixes) {
for (const auto& [_, interfaceIps] : interfaces) {
for (const auto& kv : interfaces) {
const auto& interfaceIps = kv.second;
if (kiwix::startsWith(interfaceIps.addr, prefix)) {
updatePublicIpAddress(bestPublicIps, interfaceIps);
}