must zero osiSockAddr prior to use!

RTEMS depends on this or eg. bind()
will fail because comparison with
list of interface addresses is done
with memcmp()!
This commit is contained in:
Michael Davidsaver
2017-11-28 17:32:16 -06:00
parent bc0892a1ad
commit 0161799c93
9 changed files with 19 additions and 0 deletions

View File

@ -147,6 +147,7 @@ bool processSearchResponse(osiSockAddr const & responseFrom, ByteBuffer & receiv
/*int32 searchSequenceId = */receiveBuffer.getInt();
osiSockAddr serverAddress;
memset(&serverAddress, 0, sizeof(serverAddress));
serverAddress.ia.sin_family = AF_INET;
// 128-bit IPv6 address
@ -265,6 +266,7 @@ bool discoverServers(double timeOut)
}
osiSockAddr bindAddr;
memset(&bindAddr, 0, sizeof(bindAddr));
bindAddr.ia.sin_family = AF_INET;
bindAddr.ia.sin_port = htons(0);
bindAddr.ia.sin_addr.s_addr = htonl(INADDR_ANY);