[SCM] Socket Wrapper Repository - branch master updated
Andreas Schneider
asn at samba.org
Tue Nov 6 14:01:52 UTC 2018
The branch, master has been updated
via efbb27d gitlab-ci: Enable freebsd runner
via 9c0931b tests: Disable failing tests as on FreeBSD
via 38704a9 cmake: Create a list with required libraries
via db7070c tests: Protect IPv6 function in setup_echo_srv_tcp_ipv6
via f690f8c tests: Protect IPv6 case in echo_srv
via fb4df59 swrap: Protect IPv6 case in swrap_socket()
from 916ce9c cmake: Don't use string PREPEND
https://git.samba.org/?p=socket_wrapper.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit efbb27d464afbf97e5f4b83d51f521028391a45b
Author: Andreas Schneider <asn at samba.org>
Date: Tue Oct 30 13:01:27 2018 +0100
gitlab-ci: Enable freebsd runner
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
commit 9c0931bf0ba7d3a08fe6428fa891d36d6c2130c7
Author: Andreas Schneider <asn at samba.org>
Date: Tue Oct 30 13:00:51 2018 +0100
tests: Disable failing tests as on FreeBSD
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
commit 38704a92f5ded6ac028f589632f4a305400a83ce
Author: Andreas Schneider <asn at samba.org>
Date: Wed Oct 31 08:07:17 2018 +0100
cmake: Create a list with required libraries
This should fix the build on OmniOS.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
commit db7070c65a8732996a11ce05287a2380278ec6a8
Author: Andreas Schneider <asn at samba.org>
Date: Mon Nov 5 08:29:25 2018 +0100
tests: Protect IPv6 function in setup_echo_srv_tcp_ipv6
Fixes the build on OmniOS.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
commit f690f8c0873d87359f9d3c11e46c8c4dc185af0e
Author: Andreas Schneider <asn at samba.org>
Date: Wed Oct 31 08:04:03 2018 +0100
tests: Protect IPv6 case in echo_srv
This fixes the build on OmniOS.
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
commit fb4df592a055669b8046e2d0a263b8cc49633fb0
Author: Andreas Schneider <asn at samba.org>
Date: Wed Oct 31 08:02:25 2018 +0100
swrap: Protect IPv6 case in swrap_socket()
Fixes the build on OmniOS
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Ralph Boehme <slow at samba.org>
-----------------------------------------------------------------------
Summary of changes:
.gitlab-ci.yml | 5 +----
ConfigureChecks.cmake | 7 ++++---
src/socket_wrapper.c | 2 ++
tests/CMakeLists.txt | 12 ++++++++++++
tests/echo_srv.c | 6 ++++++
tests/test_echo_tcp_bind.c | 2 ++
6 files changed, 27 insertions(+), 7 deletions(-)
Changeset truncated at 500 lines:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1f9dab3..00b4576 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -77,10 +77,7 @@ fedora/undefined-sanitizer:
paths:
- obj/
-# This runner is disabled because there is a threading race condition in
-# FreeBSD.
-# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231848
-.freebsd/x86_64:
+freebsd/x86_64:
image:
script:
- mkdir -p obj && cd obj && cmake
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index cb5bf53..17fdd3e 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -72,7 +72,7 @@ check_function_exists(pledge HAVE_PLEDGE)
if (UNIX)
find_library(DLFCN_LIBRARY dl)
if (DLFCN_LIBRARY)
- string(APPEND _REQUIRED_LIBRARIES ${DLFCN_LIBRARY})
+ list(APPEND _REQUIRED_LIBRARIES ${DLFCN_LIBRARY})
else()
check_function_exists(dlopen HAVE_DLOPEN)
if (NOT HAVE_DLOPEN)
@@ -84,13 +84,13 @@ if (UNIX)
# libsocket (Solaris)
check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
if (HAVE_LIBSOCKET)
- string(APPEND _REQUIRED_LIBRARIES socket)
+ list(APPEND _REQUIRED_LIBRARIES socket)
endif (HAVE_LIBSOCKET)
# libnsl/inet_pton (Solaris)
check_library_exists(nsl inet_pton "" HAVE_LIBNSL)
if (HAVE_LIBNSL)
- string(APPEND _REQUIRED_LIBRARIES nsl)
+ list(APPEND _REQUIRED_LIBRARIES nsl)
endif (HAVE_LIBNSL)
endif (NOT LINUX)
@@ -269,4 +269,5 @@ endif (NOT WIN32)
check_type_size(pid_t SIZEOF_PID_T)
+string(REPLACE ";" " " _REQUIRED_LIBRARIES "${_REQUIRED_LIBRARIES}")
set(SWRAP_REQUIRED_LIBRARIES ${_REQUIRED_LIBRARIES} CACHE INTERNAL "socket_wrapper required system libraries")
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 5e3a47b..a107710 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -3098,6 +3098,7 @@ static int swrap_socket(int family, int type, int protocol)
memcpy(&si->myname.sa.in, &sin, si->myname.sa_socklen);
break;
}
+#ifdef HAVE_IPV6
case AF_INET6: {
struct sockaddr_in6 sin6 = {
.sin6_family = AF_INET6,
@@ -3107,6 +3108,7 @@ static int swrap_socket(int family, int type, int protocol)
memcpy(&si->myname.sa.in6, &sin6, si->myname.sa_socklen);
break;
}
+#endif
default:
errno = EINVAL;
return -1;
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index b43d03c..2f76c6b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -102,6 +102,18 @@ foreach(_SWRAP_TEST ${SWRAP_TESTS})
add_cmocka_test_environment(${_SWRAP_TEST})
endforeach()
+# These test will fail on because there is a threading race condition in
+# FreeBSD.
+# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231848
+if (FREEBSD)
+ set_tests_properties(test_thread_echo_tcp_connect
+ PROPERTIES DISABLED TRUE)
+ set_tests_properties(test_thread_echo_tcp_write_read
+ PROPERTIES DISABLED TRUE)
+ set_tests_properties(test_thread_echo_tcp_sendmsg_recvmsg
+ PROPERTIES DISABLED TRUE)
+endif()
+
if (HELGRIND_TESTING)
find_program(VALGRIND_EXECUTABLE valgrind)
if (VALGRIND_EXECUTABLE)
diff --git a/tests/echo_srv.c b/tests/echo_srv.c
index 9a81c42..957a3ad 100644
--- a/tests/echo_srv.c
+++ b/tests/echo_srv.c
@@ -98,6 +98,7 @@ static const char *echo_server_address(int family)
return ECHO_SRV_IPV4;
}
+#ifdef HAVE_IPV6
case AF_INET6: {
const char *ip6 = getenv("TORTURE_SERVER_ADDRESS_IPV6");
@@ -107,6 +108,7 @@ static const char *echo_server_address(int family)
return ECHO_SRV_IPV6;
}
+#endif
default:
return NULL;
}
@@ -404,6 +406,7 @@ static int socket_dup(int s)
}
break;
}
+#ifdef HAVE_IPV6
case AF_INET6: {
rc = memcmp(&cli_addr1.sa.in6, &cli_addr2.sa.in6, sizeof(struct sockaddr_in6));
if (rc != 0) {
@@ -416,6 +419,7 @@ static int socket_dup(int s)
}
break;
}
+#endif
default:
perror("family mismatch");
close(s2);
@@ -464,6 +468,7 @@ static int socket_dup(int s)
}
break;
}
+#ifdef HAVE_IPV6
case AF_INET6: {
rc = memcmp(&cli_addr1.sa.in6, &cli_addr2.sa.in6, sizeof(struct sockaddr_in6));
if (rc != 0) {
@@ -476,6 +481,7 @@ static int socket_dup(int s)
}
break;
}
+#endif
default:
perror("family mismatch");
close(s);
diff --git a/tests/test_echo_tcp_bind.c b/tests/test_echo_tcp_bind.c
index 796c362..8718367 100644
--- a/tests/test_echo_tcp_bind.c
+++ b/tests/test_echo_tcp_bind.c
@@ -26,12 +26,14 @@ static int setup_echo_srv_tcp_ipv4(void **state)
return 0;
}
+#ifdef HAVE_IPV6
static int setup_echo_srv_tcp_ipv6(void **state)
{
torture_setup_echo_srv_tcp_ipv6(state);
return 0;
}
+#endif
static int teardown(void **state)
{
--
Socket Wrapper Repository
More information about the samba-cvs
mailing list