summaryrefslogtreecommitdiff
path: root/source4/lib/socket
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/socket')
-rw-r--r--source4/lib/socket/config.m454
-rw-r--r--source4/lib/socket/config.mk11
-rw-r--r--source4/lib/socket/testsuite.c2
3 files changed, 15 insertions, 52 deletions
diff --git a/source4/lib/socket/config.m4 b/source4/lib/socket/config.m4
index b40002b321..9c0072dd8b 100644
--- a/source4/lib/socket/config.m4
+++ b/source4/lib/socket/config.m4
@@ -1,57 +1,19 @@
AC_CHECK_FUNCS(writev)
AC_CHECK_FUNCS(readv)
-
-AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],
-[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
-samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
-if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
- AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
-fi
+AC_CHECK_FUNCS(gethostbyname2)
############################################
# check for unix domain sockets
-AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/socket.h>
-#include <sys/un.h>],
-[
- struct sockaddr_un sunaddr;
- sunaddr.sun_family = AF_UNIX;
-],
- samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
+# done by AC_LIBREPLACE_NETWORK_CHECKS
SMB_ENABLE(socket_unix, NO)
-if test x"$samba_cv_unixsocket" = x"yes"; then
- SMB_ENABLE(socket_unix, YES)
- AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
+if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"yes"; then
+ SMB_ENABLE(socket_unix, YES)
fi
-AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
-AC_TRY_RUN([#include "${srcdir-.}/build/tests/unixsock.c"],
- samba_cv_HAVE_WORKING_AF_LOCAL=yes,
- samba_cv_HAVE_WORKING_AF_LOCAL=no,
- samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
-if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
-then
- AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
-fi
-
-dnl test for ipv6 using the gethostbyname2() function. That should be sufficient
-dnl for now
-AC_CHECK_FUNCS(gethostbyname2, have_ipv6=true, have_ipv6=false)
+############################################
+# check for ipv6
+# done by AC_LIBREPLACE_NETWORK_CHECKS
SMB_ENABLE(socket_ipv6, NO)
-if $have_ipv6 = true; then
+if test x"$libreplace_cv_HAVE_IPV6" = x"yes"; then
SMB_ENABLE(socket_ipv6, YES)
- AC_DEFINE(HAVE_IPV6,1,[Whether the system has ipv6 support])
fi
-dnl don't build ipv6 by default, unless the above test enables it, or
-dnl the configure uses --with-static-modules=socket_ipv6
-
-
-
-
diff --git a/source4/lib/socket/config.mk b/source4/lib/socket/config.mk
index 2400190175..18aa806e41 100644
--- a/source4/lib/socket/config.mk
+++ b/source4/lib/socket/config.mk
@@ -1,12 +1,13 @@
##############################
# Start SUBSYSTEM LIBNETIF
[SUBSYSTEM::LIBNETIF]
-PRIVATE_PROTO_HEADER = netif_proto.h
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBREPLACE_NETWORK
# End SUBSYSTEM LIBNETIF
##############################
-LIBNETIF_OBJ_FILES = $(addprefix lib/socket/, interface.o netif.o)
+LIBNETIF_OBJ_FILES = $(addprefix $(libsocketsrcdir)/, interface.o netif.o)
+
+$(eval $(call proto_header_template,$(libsocketsrcdir)/netif_proto.h,$(LIBNETIF_OBJ_FILES:.o=.c)))
################################################
# Start MODULE socket_ip
@@ -17,7 +18,7 @@ PRIVATE_DEPENDENCIES = LIBSAMBA-ERRORS LIBREPLACE_NETWORK
# End MODULE socket_ip
################################################
-socket_ip_OBJ_FILES = lib/socket/socket_ip.o
+socket_ip_OBJ_FILES = $(libsocketsrcdir)/socket_ip.o
################################################
# Start MODULE socket_unix
@@ -28,7 +29,7 @@ PRIVATE_DEPENDENCIES = LIBREPLACE_NETWORK
# End MODULE socket_unix
################################################
-socket_unix_OBJ_FILES = lib/socket/socket_unix.o
+socket_unix_OBJ_FILES = $(libsocketsrcdir)/socket_unix.o
################################################
# Start SUBSYSTEM SOCKET
@@ -38,5 +39,5 @@ PRIVATE_DEPENDENCIES = SOCKET_WRAPPER LIBCLI_COMPOSITE LIBCLI_RESOLVE
# End SUBSYSTEM SOCKET
################################################
-samba-socket_OBJ_FILES = $(addprefix lib/socket/, socket.o access.o connect_multi.o connect.o)
+samba-socket_OBJ_FILES = $(addprefix $(libsocketsrcdir)/, socket.o access.o connect_multi.o connect.o)
diff --git a/source4/lib/socket/testsuite.c b/source4/lib/socket/testsuite.c
index 813412c7bc..2c25d8f491 100644
--- a/source4/lib/socket/testsuite.c
+++ b/source4/lib/socket/testsuite.c
@@ -124,7 +124,7 @@ static bool test_tcp(struct torture_context *tctx)
DATA_BLOB blob, blob2;
size_t sent, nread;
TALLOC_CTX *mem_ctx = tctx;
- struct event_context *ev = event_context_init(mem_ctx);
+ struct event_context *ev = tctx->ev;
struct interface *ifaces;
status = socket_create("ip", SOCKET_TYPE_STREAM, &sock1, 0);