Merge remote-tracking branch 'upstream/master' into security

This commit is contained in:
Erik Boasson 2020-05-11 15:05:46 +02:00
commit 2da100a3c7
35 changed files with 671 additions and 157 deletions

View file

@ -62,6 +62,10 @@ if(WITH_FREERTOS)
set(system_name freertos)
elseif(APPLE)
set(system_name darwin)
elseif(ANDROID)
# FIXME: Not correct, but will do for the short-term. A better way would be
# fallback to linux, and then posix.
set(system_name linux)
else()
string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name)
endif()

View file

@ -32,9 +32,9 @@
#include <fcntl.h>
#endif
#ifdef __APPLE__
#if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/sockio.h>
#endif /* __APPLE__ */
#endif /* __APPLE__ || __FreeBSD__ */
#endif /* LWIP_SOCKET */
dds_return_t
@ -316,13 +316,13 @@ ddsrt_setsockopt(
goto err_setsockopt;
}
#if defined(__APPLE__)
#if defined(__APPLE__) || defined(__FreeBSD__)
if (level == SOL_SOCKET && optname == SO_REUSEADDR &&
setsockopt(sock, level, SO_REUSEPORT, optval, optlen) == -1)
{
goto err_setsockopt;
}
#endif /* __APPLE__ */
#endif /* __APPLE__ || __FreeBSD__ */
return DDS_RETCODE_OK;
err_setsockopt: