diff --git a/configs/fne-config.example.yml b/configs/fne-config.example.yml index 22b49265..07baf74b 100644 --- a/configs/fne-config.example.yml +++ b/configs/fne-config.example.yml @@ -114,10 +114,6 @@ peers: - name: EXAMPLEPEER # Flag indicating whether or not the peer is enabled. enabled: true - # Hostname/IP address to listen on (blank for all). - address: 127.0.0.1 - # Port number to listen on. - port: 32091 # Hostname/IP address of the FNE master to connect to. masterAddress: 127.0.0.1 # Port number of the FNE master to connect to. diff --git a/src/common/network/udp/Socket.cpp b/src/common/network/udp/Socket.cpp index 7ebd815a..e272ffa7 100644 --- a/src/common/network/udp/Socket.cpp +++ b/src/common/network/udp/Socket.cpp @@ -295,7 +295,7 @@ bool Socket::write(const uint8_t* buffer, uint32_t length, const sockaddr_storag *lenWritten = -1; } - LogError(LOG_NET, "tried to write datagram with no file descriptor? this shouldn't happen BUGBUG"); + //LogError(LOG_NET, "tried to write datagram with no file descriptor? this shouldn't happen BUGBUG"); return false; } diff --git a/src/fne/HostFNE.cpp b/src/fne/HostFNE.cpp index a82e2598..70453072 100644 --- a/src/fne/HostFNE.cpp +++ b/src/fne/HostFNE.cpp @@ -237,6 +237,11 @@ int HostFNE::run() if (peerNetwork != nullptr) { peerNetwork->clock(ms); + // skip peer if it isn't enabled + if (!peerNetwork->isEnabled()) { + continue; + } + // process peer network traffic processPeer(peerNetwork); } diff --git a/src/fne/network/fne/TagDMRData.cpp b/src/fne/network/fne/TagDMRData.cpp index ad4c890a..8df72ac8 100644 --- a/src/fne/network/fne/TagDMRData.cpp +++ b/src/fne/network/fne/TagDMRData.cpp @@ -304,6 +304,11 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId continue; } + // skip peer if it isn't enabled + if (!peer.second->isEnabled()) { + continue; + } + uint8_t outboundPeerBuffer[len]; ::memset(outboundPeerBuffer, 0x00U, len); ::memcpy(outboundPeerBuffer, buffer, len); diff --git a/src/fne/network/fne/TagNXDNData.cpp b/src/fne/network/fne/TagNXDNData.cpp index 4f829811..985d13d4 100644 --- a/src/fne/network/fne/TagNXDNData.cpp +++ b/src/fne/network/fne/TagNXDNData.cpp @@ -269,6 +269,11 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI continue; } + // skip peer if it isn't enabled + if (!peer.second->isEnabled()) { + continue; + } + uint8_t outboundPeerBuffer[len]; ::memset(outboundPeerBuffer, 0x00U, len); ::memcpy(outboundPeerBuffer, buffer, len); diff --git a/src/fne/network/fne/TagP25Data.cpp b/src/fne/network/fne/TagP25Data.cpp index 40afb9cc..78d766ba 100644 --- a/src/fne/network/fne/TagP25Data.cpp +++ b/src/fne/network/fne/TagP25Data.cpp @@ -337,6 +337,11 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId continue; } + // skip peer if it isn't enabled + if (!peer.second->isEnabled()) { + continue; + } + uint8_t outboundPeerBuffer[len]; ::memset(outboundPeerBuffer, 0x00U, len); ::memcpy(outboundPeerBuffer, buffer, len); diff --git a/src/host/network/Network.h b/src/host/network/Network.h index 130ea8ad..4be856a9 100644 --- a/src/host/network/Network.h +++ b/src/host/network/Network.h @@ -66,6 +66,8 @@ namespace network /// Closes connection to the network. void close() override; + /// Flat indicating if this network connection enabled. + bool isEnabled() const { return m_enabled; } /// Sets flag enabling network communication. void enable(bool enabled);