Skip to content

Commit

Permalink
Fix broken CI on Linux (aarch64, focal)
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan committed Oct 3, 2024
1 parent 8bbda99 commit b8e510f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tools/networkTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ size_t write_callback_to_iss(char* ptr, size_t size, size_t nmemb, void* userdat
return nmemb;
}

void updatePublicIpAddress(IpAddress& publicIpAddr, const IpAddress& interfaceIpAddr)
void updatePublicIpAddress(IpAddress& publicIpAddr, const IpAddress& interfaceIpAddr)
{
if (publicIpAddr.addr.empty()) publicIpAddr.addr = interfaceIpAddr.addr;
if (publicIpAddr.addr6.empty()) publicIpAddr.addr6 = interfaceIpAddr.addr6;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit b8e510f

Please sign in to comment.