From 58c671de0d1aadd47c84527a6463173a0ef0f5e7 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Mon, 16 Feb 2026 16:56:33 +0100 Subject: [PATCH 1/7] bump GPSD version --- Common/APRSGPSDIdFrameProvider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/APRSGPSDIdFrameProvider.cpp b/Common/APRSGPSDIdFrameProvider.cpp index 4891a78..b64b770 100644 --- a/Common/APRSGPSDIdFrameProvider.cpp +++ b/Common/APRSGPSDIdFrameProvider.cpp @@ -80,7 +80,7 @@ bool CAPRSGPSDIdFrameProvider::buildAPRSFramesInt(const CAPRSEntry * entry, std: #elif GPSD_API_MAJOR_VERSION == 11 if(m_gpsdData.fix.status == STATUS_NO_FIX) return false; -#elif GPSD_API_MAJOR_VERSION <= 14 +#elif GPSD_API_MAJOR_VERSION <= 16 if(m_gpsdData.fix.status == STATUS_UNK) return false; #elif From 14225e61504eadb3da751b24ac88f2f685ea525b Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Mon, 16 Feb 2026 17:26:20 +0100 Subject: [PATCH 2/7] #62 Only match incoming G2 on port and IP --- Common/G2ProtocolHandlerPool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/G2ProtocolHandlerPool.cpp b/Common/G2ProtocolHandlerPool.cpp index 7db90d8..c93fb00 100644 --- a/Common/G2ProtocolHandlerPool.cpp +++ b/Common/G2ProtocolHandlerPool.cpp @@ -128,8 +128,8 @@ void CG2ProtocolHandlerPool::traverseNat(const std::string& address) bool CG2ProtocolHandlerPool::writeHeader(const CHeaderData& header) { auto handler = findHandler(header.getDestination(), IMT_ADDRESS_AND_PORT); - if(handler == nullptr) - handler = findHandler(header.getDestination(), IMT_ADDRESS_ONLY); + // if(handler == nullptr) + // handler = findHandler(header.getDestination(), IMT_ADDRESS_ONLY); if(handler == nullptr) { handler = new CG2ProtocolHandler(&m_socket, header.getDestination(), G2_BUFFER_LENGTH); From 0766de6dbf1da6803ae41fc1093a2d92c4021390 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Mon, 16 Feb 2026 20:45:44 +0100 Subject: [PATCH 3/7] #62 reste id for new header --- Common/G2ProtocolHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/G2ProtocolHandler.cpp b/Common/G2ProtocolHandler.cpp index 5592acd..8aff591 100644 --- a/Common/G2ProtocolHandler.cpp +++ b/Common/G2ProtocolHandler.cpp @@ -104,6 +104,7 @@ bool CG2ProtocolHandler::setBuffer(unsigned char * buffer, int length) // Header or data packet type? if ((m_buffer[14] & 0x80) == 0x80) { m_type = GT_HEADER; + m_id = 0U; // reset the id for new header } else { m_type = GT_AMBE; From 24f2d5b53cbef365a345b2f3e939caf757c0b094 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Mon, 16 Feb 2026 20:46:29 +0100 Subject: [PATCH 4/7] #62 add some more trace ogging output --- Common/G2ProtocolHandlerPool.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Common/G2ProtocolHandlerPool.cpp b/Common/G2ProtocolHandlerPool.cpp index c93fb00..8ce4699 100644 --- a/Common/G2ProtocolHandlerPool.cpp +++ b/Common/G2ProtocolHandlerPool.cpp @@ -104,10 +104,10 @@ bool CG2ProtocolHandlerPool::readPackets() CG2ProtocolHandler * handler = findHandler(addr, IMT_ADDRESS_AND_PORT); if(handler == nullptr) { - CLog::logTrace("new incoming G2 %s:%u", inet_ntoa(TOIPV4(addr)->sin_addr), ntohs(TOIPV4(addr)->sin_port)); handler = new CG2ProtocolHandler(&m_socket, addr, G2_BUFFER_LENGTH); m_pool.push_back(handler); m_index = m_pool.end(); + CLog::logTrace("new incoming G2 %s:%u N G2 Count %d", inet_ntoa(TOIPV4(addr)->sin_addr), ntohs(TOIPV4(addr)->sin_port), m_pool.size()); } bool res = handler->setBuffer(buffer, length); @@ -128,13 +128,15 @@ void CG2ProtocolHandlerPool::traverseNat(const std::string& address) bool CG2ProtocolHandlerPool::writeHeader(const CHeaderData& header) { auto handler = findHandler(header.getDestination(), IMT_ADDRESS_AND_PORT); - // if(handler == nullptr) - // handler = findHandler(header.getDestination(), IMT_ADDRESS_ONLY); + if(handler == nullptr) + handler = findHandler(header.getDestination(), IMT_ADDRESS_ONLY); if(handler == nullptr) { handler = new CG2ProtocolHandler(&m_socket, header.getDestination(), G2_BUFFER_LENGTH); m_pool.push_back(handler); m_index = m_pool.end(); + auto addr = header.getDestination(); + CLog::logTrace("new outgoing G2 %s:%u H G2 Count %d", inet_ntoa(TOIPV4(addr)->sin_addr), ntohs(TOIPV4(addr)->sin_port), m_pool.size()); } return handler->writeHeader(header); } @@ -149,6 +151,8 @@ bool CG2ProtocolHandlerPool::writeAMBE(const CAMBEData& data) handler = new CG2ProtocolHandler(&m_socket, data.getDestination(), G2_BUFFER_LENGTH); m_pool.push_back(handler); m_index = m_pool.end(); + auto addr = data.getDestination(); + CLog::logTrace("new outgoing G2 %s:%u A G2 Count %d", inet_ntoa(TOIPV4(addr)->sin_addr), ntohs(TOIPV4(addr)->sin_port), m_pool.size()); } return handler->writeAMBE(data); From 4c15d6dd74856a3e112b73d6d4c325e91378bc51 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Mon, 16 Feb 2026 21:00:23 +0100 Subject: [PATCH 5/7] #62 make sure we resize with blanks --- DStarGateway/DStarGatewayThread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DStarGateway/DStarGatewayThread.cpp b/DStarGateway/DStarGatewayThread.cpp index d86922d..f6f0509 100644 --- a/DStarGateway/DStarGatewayThread.cpp +++ b/DStarGateway/DStarGatewayThread.cpp @@ -521,7 +521,7 @@ void CDStarGatewayThread::addRepeater(const std::string& callsign, const std::st CRepeaterHandler::add(callsign, band, address, port, hwType, reflector, atStartup, reconnect, dratsEnabled, frequency, offset, range, latitude, longitude, agl, description1, description2, url, handler, band1, band2, band3); std::string repeater = callsign; - repeater.resize(LONG_CALLSIGN_LENGTH - 1U); + repeater.resize(LONG_CALLSIGN_LENGTH - 1U, ' '); repeater += band; // Add a fixed address and protocol for the local repeaters From 2c54fd272823a6f639be7be36e9984520d10b38e Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Mon, 16 Feb 2026 21:05:08 +0100 Subject: [PATCH 6/7] #62 do not do notify NAT traversal tou ourselves --- Common/RepeaterHandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Common/RepeaterHandler.cpp b/Common/RepeaterHandler.cpp index b100cf1..27aa600 100644 --- a/Common/RepeaterHandler.cpp +++ b/Common/RepeaterHandler.cpp @@ -1975,7 +1975,10 @@ void CRepeaterHandler::g2CommandHandler(const std::string& callsign, const std:: m_g2User = "CQCQCQ "; CRepeaterData* data = m_cache->findRepeater(m_g2Repeater); - m_irc->notifyRepeaterG2NatTraversal(m_g2Repeater); + if( data != NULL && data->getRepeater() == m_rptCallsign) { + // No point NAT traversal to ourselves + m_irc->notifyRepeaterG2NatTraversal(m_g2Repeater); + } if (data == NULL) { m_g2Status = G2_REPEATER; From 3fcc072bbd125c36ff7bcd1b67e785d19f7621c7 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Tue, 17 Feb 2026 19:45:07 +0100 Subject: [PATCH 7/7] #62 updqte --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 19391a9..e9ab390 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ The testing framwework used is Google Test. # 6. Version History ## 6.1. Version 1.0 +- [**Bugfix**] Fix program stops responding and uses 100% cpu when cross banding using gateway call or callsign routing ([#62](https://github.com/F4FXL/DStarGateway/issues/62)) - [**Improvement**] Improve threading handling ([#58](https://github.com/F4FXL/DStarGateway/issues/58)) - [**Improvement**] Add Add an option to disable logging of ircddb traffic ([#59](https://github.com/F4FXL/DStarGateway/issues/59)) - [**Bugfix**] Fix repeater not reverting to startup reflector after issueing a command through remote control. ([#57](https://github.com/F4FXL/DStarGateway/issues/57))