[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Dec 20 02:55:01 MST 2013


The branch, master has been updated
       via  1e413ec echo_srv: Add missing includes.
       via  0f203f2 torture: Set different default interface for client and server.
       via  b9b05b1 swrap: Add documentation for SOCK_CLOEXEC in socket().
      from  3c3b7f6 tests: Add test_echo_tcp_write_read.

http://gitweb.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1e413ec5497c82375dd11739912ddedd4743bb5f
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Dec 20 10:54:20 2013 +0100

    echo_srv: Add missing includes.
    
    This should fix the build on FreeBSD.

commit 0f203f240b884f71aa5b24887447581822121354
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 19 15:34:10 2013 +0100

    torture: Set different default interface for client and server.

commit b9b05b13d2731fa287fed5ffb602844828e3bb50
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 19 14:29:52 2013 +0100

    swrap: Add documentation for SOCK_CLOEXEC in socket().

-----------------------------------------------------------------------

Summary of changes:
 src/socket_wrapper.c |    6 ++++++
 tests/echo_srv.c     |   18 +++++++++++-------
 tests/torture.c      |    8 +++++++-
 3 files changed, 24 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 0fcdb99..62e83ef 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1929,6 +1929,12 @@ static int swrap_socket(int family, int type, int protocol)
 	struct socket_info_fd *fi;
 	int fd;
 	int real_type = type;
+
+	/*
+	 * Remove possible addition flags passed to socket() so
+	 * do not fail checking the type.
+	 * See https://lwn.net/Articles/281965/
+	 */
 #ifdef SOCK_CLOEXEC
 	real_type &= ~SOCK_CLOEXEC;
 #endif
diff --git a/tests/echo_srv.c b/tests/echo_srv.c
index dd6fafd..a207419 100644
--- a/tests/echo_srv.c
+++ b/tests/echo_srv.c
@@ -1,17 +1,21 @@
-#include <stdio.h>
-#include <stdlib.h>
 #include <errno.h>
-#include <sys/socket.h>
+
 #include <sys/types.h>
+#include <sys/socket.h>
 #include <sys/stat.h>
-#include <resolv.h>
+
 #include <arpa/inet.h>
-#include <errno.h>
+#include <netinet/in.h>
 #include <netdb.h>
-#include <string.h>
+#include <resolv.h>
+
+#include <fcntl.h>
 #include <getopt.h>
 #include <unistd.h>
-#include <fcntl.h>
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <stdbool.h>
 
 #ifndef PIDFILE
diff --git a/tests/torture.c b/tests/torture.c
index d44fa25..75a4280 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -75,7 +75,7 @@ void torture_setup_socket_dir(void **state)
 	snprintf(s->srv_pidfile, len, "%s/%s", p, TORTURE_ECHO_SRV_PIDFILE);
 
 	setenv("SOCKET_WRAPPER_DIR", p, 1);
-	setenv("SOCKET_WRAPPER_DEFAULT_IFACE", "21", 1);
+	setenv("SOCKET_WRAPPER_DEFAULT_IFACE", "170", 1);
 
 	*state = s;
 }
@@ -105,6 +105,9 @@ static void torture_setup_echo_srv_ip(void **state,
 		break;
 	}
 
+	/* set default iface for the server */
+	setenv("SOCKET_WRAPPER_DEFAULT_IFACE", "10", 1);
+
 	snprintf(start_echo_srv, sizeof(start_echo_srv),
 		 "%s/tests/echo_srv -b %s -D %s --pid %s",
 		 BINARYDIR, ip, t, s->srv_pidfile);
@@ -113,6 +116,9 @@ static void torture_setup_echo_srv_ip(void **state,
 	assert_int_equal(rc, 0);
 
 	sleep(1);
+
+	/* set default iface for the client */
+	setenv("SOCKET_WRAPPER_DEFAULT_IFACE", "170", 1);
 }
 
 void torture_setup_echo_srv_udp_ipv4(void **state)


-- 
Socket Wrapper Repository


More information about the samba-cvs mailing list