From 95096d83dec25af5f266fadb2dd73ce486bf3340 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 17 Mar 2021 15:43:01 +0100 Subject: [PATCH 1/5] fixed bug --- datapoollocal/LocalPoolDataSetBase.cpp | 2 +- osal/windows/TcWinTcpServer.cpp | 2 ++ osal/windows/TmTcWinUdpBridge.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/datapoollocal/LocalPoolDataSetBase.cpp b/datapoollocal/LocalPoolDataSetBase.cpp index 99c7a1cd..d7894048 100644 --- a/datapoollocal/LocalPoolDataSetBase.cpp +++ b/datapoollocal/LocalPoolDataSetBase.cpp @@ -103,7 +103,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeWithValidityBuffer(uint8_t **buffer std::vector validityMask(validityMaskSize); validityPtr = validityMask.data(); #else - uint8_t validityMask[validityMaskSize]; + uint8_t validityMask[validityMaskSize] = {}; validityPtr = validityMask; #endif uint8_t validBufferIndex = 0; diff --git a/osal/windows/TcWinTcpServer.cpp b/osal/windows/TcWinTcpServer.cpp index 49c278c5..f68edfba 100644 --- a/osal/windows/TcWinTcpServer.cpp +++ b/osal/windows/TcWinTcpServer.cpp @@ -64,8 +64,10 @@ ReturnValue_t TcWinTcpServer::initialize() { retval = bind(listenerTcpSocket, addrResult->ai_addr, static_cast(addrResult->ai_addrlen)); if(retval == SOCKET_ERROR) { +#if FSFW_CPP_OSTREAM_ENABLED == 1 sif::warning << "TcWinTcpServer::TcWinTcpServer: Binding socket failed!" << std::endl; +#endif freeaddrinfo(addrResult); handleError(Protocol::TCP, ErrorSources::BIND_CALL); } diff --git a/osal/windows/TmTcWinUdpBridge.h b/osal/windows/TmTcWinUdpBridge.h index 51dcfe99..c2f7d6aa 100644 --- a/osal/windows/TmTcWinUdpBridge.h +++ b/osal/windows/TmTcWinUdpBridge.h @@ -3,6 +3,7 @@ #include "../../tmtcservices/TmTcBridge.h" +#include #include class TmTcWinUdpBridge: public TmTcBridge { From 1b8878a81f039bb813c718006c48e01b53191803 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 17 Mar 2021 15:46:17 +0100 Subject: [PATCH 2/5] more explicit --- datapoollocal/LocalPoolDataSetBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapoollocal/LocalPoolDataSetBase.cpp b/datapoollocal/LocalPoolDataSetBase.cpp index d7894048..7f181c93 100644 --- a/datapoollocal/LocalPoolDataSetBase.cpp +++ b/datapoollocal/LocalPoolDataSetBase.cpp @@ -103,7 +103,7 @@ ReturnValue_t LocalPoolDataSetBase::serializeWithValidityBuffer(uint8_t **buffer std::vector validityMask(validityMaskSize); validityPtr = validityMask.data(); #else - uint8_t validityMask[validityMaskSize] = {}; + uint8_t validityMask[validityMaskSize] = {0}; validityPtr = validityMask; #endif uint8_t validBufferIndex = 0; From aa849894c65309a269475dca704b6bddb07702b7 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 18 Mar 2021 20:09:19 +0100 Subject: [PATCH 3/5] tiny form improvement --- datapoollocal/LocalPoolDataSetBase.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datapoollocal/LocalPoolDataSetBase.cpp b/datapoollocal/LocalPoolDataSetBase.cpp index 7f181c93..a72e9db1 100644 --- a/datapoollocal/LocalPoolDataSetBase.cpp +++ b/datapoollocal/LocalPoolDataSetBase.cpp @@ -58,8 +58,7 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(sid_t sid, PoolVariableIF** registere this->sid = sid; } -LocalPoolDataSetBase::LocalPoolDataSetBase( - PoolVariableIF **registeredVariablesArray, +LocalPoolDataSetBase::LocalPoolDataSetBase(PoolVariableIF **registeredVariablesArray, const size_t maxNumberOfVariables, bool protectEveryReadCommitCall): PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) { this->setReadCommitProtectionBehaviour(protectEveryReadCommitCall); From fe2b3a01cf73b2dec12699365a4e5bb9acb689c2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 20 Mar 2021 12:38:51 +0100 Subject: [PATCH 4/5] important bugfix --- osal/windows/TmTcWinUdpBridge.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osal/windows/TmTcWinUdpBridge.cpp b/osal/windows/TmTcWinUdpBridge.cpp index fd289ed8..8755c84a 100644 --- a/osal/windows/TmTcWinUdpBridge.cpp +++ b/osal/windows/TmTcWinUdpBridge.cpp @@ -58,6 +58,9 @@ ReturnValue_t TmTcWinUdpBridge::initialize() { hints.ai_family = AF_INET; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; + /* See: + https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo + for information about AI_PASSIVE. */ hints.ai_flags = AI_PASSIVE; /* Set up UDP socket: @@ -151,11 +154,9 @@ void TmTcWinUdpBridge::checkAndSetClientAddress(sockaddr_in& newAddress) { #endif registerCommConnect(); - /* Set new IP address if it has changed. */ - if(clientAddress.sin_addr.s_addr != newAddress.sin_addr.s_addr) { - clientAddress = newAddress; - clientAddressLen = sizeof(clientAddress); - } + /* Set new IP address to reply to */ + clientAddress = newAddress; + clientAddressLen = sizeof(clientAddress); } void TmTcWinUdpBridge::setMutexProperties(MutexIF::TimeoutType timeoutType, From e44f8bfea38f5e876328af9d26806dc4d94bf8e8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 20 Mar 2021 12:40:25 +0100 Subject: [PATCH 5/5] important bugfixes --- osal/linux/TmTcUnixUdpBridge.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osal/linux/TmTcUnixUdpBridge.cpp b/osal/linux/TmTcUnixUdpBridge.cpp index 2f620849..fa7913ea 100644 --- a/osal/linux/TmTcUnixUdpBridge.cpp +++ b/osal/linux/TmTcUnixUdpBridge.cpp @@ -150,11 +150,9 @@ void TmTcUnixUdpBridge::checkAndSetClientAddress(sockaddr_in& newAddress) { #endif registerCommConnect(); - /* Set new IP address if it has changed. */ - if(clientAddress.sin_addr.s_addr != newAddress.sin_addr.s_addr) { - clientAddress = newAddress; - clientAddressLen = sizeof(clientAddress); - } + /* Set new IP address to reply to. */ + clientAddress = newAddress; + clientAddressLen = sizeof(clientAddress); } void TmTcUnixUdpBridge::setMutexProperties(MutexIF::TimeoutType timeoutType,