diff --git a/src/common/network/Network.cpp b/src/common/network/Network.cpp index 821e957b..8d132f98 100644 --- a/src/common/network/Network.cpp +++ b/src/common/network/Network.cpp @@ -952,6 +952,8 @@ void Network::clock(uint32_t ms) // always add the configured address to the HA IP list m_haIPs.push_back(PeerHAIPEntry(m_configuredAddress, m_configuredPort)); + if (m_debug) + LogDebugEx(LOG_NET, "Network::clock()", "HA PARAMS, 1, %s:%u", m_configuredAddress.c_str(), m_configuredPort); uint32_t len = GET_UINT32(buffer, 6U); if (len > 0U) { @@ -965,8 +967,12 @@ void Network::clock(uint32_t ms) std::string address = __IP_FROM_UINT(ipAddr); + if (address == m_configuredAddress && port == m_configuredPort) { + continue; // skip if this is the same as our configured address + } + if (m_debug) - LogDebugEx(LOG_NET, "Network::clock()", "HA PARAMS, %s:%u", address.c_str(), port); + LogDebugEx(LOG_NET, "Network::clock()", "HA PARAMS, %u, %s:%u", i + 2, address.c_str(), port); m_haIPs.push_back(PeerHAIPEntry(address, port)); } @@ -974,7 +980,8 @@ void Network::clock(uint32_t ms) if (m_haIPs.size() > 1U) { m_currentHAIP = 1U; // because the first entry is our configured entry, set // the current HA IP to the next available - LogInfoEx(LOG_NET, "Loaded %u HA IPs from master", m_haIPs.size() - 1U); + LogInfoEx(LOG_NET, "Loaded %u HA IPs from master", m_haIPs.size()); + LogInfoEx(LOG_NET, "Current HA IP %s:%u", m_haIPs[m_currentHAIP].masterAddress.c_str(), m_haIPs[m_currentHAIP].masterPort); } } } diff --git a/src/fne/network/MetadataNetwork.cpp b/src/fne/network/MetadataNetwork.cpp index aae5a7ef..ea05dc45 100644 --- a/src/fne/network/MetadataNetwork.cpp +++ b/src/fne/network/MetadataNetwork.cpp @@ -1308,7 +1308,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req) if (network->m_debug) { std::string address = __IP_FROM_UINT(rxEntry.masterIP); - LogDebugEx(LOG_REPL, "MetadataNetwork::taskNetworkRx", "PEER %u (%s) Peer Replication, HA Parameters, %s:%u", peerId, connection->identWithQualifier().c_str(), + LogDebugEx(LOG_REPL, "MetadataNetwork::taskNetworkRx()", "PEER %u (%s) Peer Replication, HA Parameters, %s:%u", peerId, connection->identWithQualifier().c_str(), address.c_str(), rxEntry.masterPort); } }