Merge pull request 'UDP Hotfix' (#390) from mueller/udp-hotfix into development

Reviewed-on: fsfw/fsfw#390
This commit is contained in:
Steffen Gaisser 2021-03-23 14:21:43 +01:00
commit d1265a55b4
3 changed files with 10 additions and 12 deletions

View File

@ -58,8 +58,7 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(sid_t sid, PoolVariableIF** registere
this->sid = sid; this->sid = sid;
} }
LocalPoolDataSetBase::LocalPoolDataSetBase( LocalPoolDataSetBase::LocalPoolDataSetBase(PoolVariableIF **registeredVariablesArray,
PoolVariableIF **registeredVariablesArray,
const size_t maxNumberOfVariables, bool protectEveryReadCommitCall): const size_t maxNumberOfVariables, bool protectEveryReadCommitCall):
PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) { PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) {
this->setReadCommitProtectionBehaviour(protectEveryReadCommitCall); this->setReadCommitProtectionBehaviour(protectEveryReadCommitCall);

View File

@ -150,12 +150,10 @@ void TmTcUnixUdpBridge::checkAndSetClientAddress(sockaddr_in& newAddress) {
#endif #endif
registerCommConnect(); registerCommConnect();
/* Set new IP address if it has changed. */ /* Set new IP address to reply to. */
if(clientAddress.sin_addr.s_addr != newAddress.sin_addr.s_addr) {
clientAddress = newAddress; clientAddress = newAddress;
clientAddressLen = sizeof(clientAddress); clientAddressLen = sizeof(clientAddress);
} }
}
void TmTcUnixUdpBridge::setMutexProperties(MutexIF::TimeoutType timeoutType, void TmTcUnixUdpBridge::setMutexProperties(MutexIF::TimeoutType timeoutType,
dur_millis_t timeoutMs) { dur_millis_t timeoutMs) {

View File

@ -58,6 +58,9 @@ ReturnValue_t TmTcWinUdpBridge::initialize() {
hints.ai_family = AF_INET; hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_DGRAM; hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP; 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; hints.ai_flags = AI_PASSIVE;
/* Set up UDP socket: /* Set up UDP socket:
@ -151,12 +154,10 @@ void TmTcWinUdpBridge::checkAndSetClientAddress(sockaddr_in& newAddress) {
#endif #endif
registerCommConnect(); registerCommConnect();
/* Set new IP address if it has changed. */ /* Set new IP address to reply to */
if(clientAddress.sin_addr.s_addr != newAddress.sin_addr.s_addr) {
clientAddress = newAddress; clientAddress = newAddress;
clientAddressLen = sizeof(clientAddress); clientAddressLen = sizeof(clientAddress);
} }
}
void TmTcWinUdpBridge::setMutexProperties(MutexIF::TimeoutType timeoutType, void TmTcWinUdpBridge::setMutexProperties(MutexIF::TimeoutType timeoutType,
dur_millis_t timeoutMs) { dur_millis_t timeoutMs) {