socket_wrapper: sync missing stuff from v4-0-test
authorStefan Metzmacher <metze@samba.org>
Tue, 10 Jun 2008 07:21:05 +0000 (09:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 10 Jun 2008 09:38:05 +0000 (11:38 +0200)
metze

source/lib/socket_wrapper/config.m4
source/lib/socket_wrapper/config.mk [new file with mode: 0644]
source/lib/socket_wrapper/socket_wrapper.c
source/lib/socket_wrapper/socket_wrapper.h
source/lib/socket_wrapper/testsuite.c

index 42212abc7fcfa7ddbce0a78cbfc774e6c4953b65..f3ffb895a90600a1dd58956c417c405316aab2e9 100644 (file)
@@ -1,22 +1,22 @@
 AC_ARG_ENABLE(socket-wrapper, 
 [  --enable-socket-wrapper         Turn on socket wrapper library (default=no)])
 
-DEFAULT_TEST_TARGET=test-noswrap
+DEFAULT_TEST_OPTIONS=
 HAVE_SOCKET_WRAPPER=no
 
 if eval "test x$developer = xyes"; then
        enable_socket_wrapper=yes
 fi
-
+    
 if eval "test x$enable_socket_wrapper = xyes"; then
         AC_DEFINE(SOCKET_WRAPPER,1,[Use socket wrapper library])
-       DEFAULT_TEST_TARGET=test-swrap
+       DEFAULT_TEST_OPTIONS=--socket-wrapper
        HAVE_SOCKET_WRAPPER=yes
 
        # this is only used for samba3
        SOCKET_WRAPPER_OBJS="lib/socket_wrapper/socket_wrapper.o"
 fi
 
-AC_SUBST(DEFAULT_TEST_TARGET)
+AC_SUBST(DEFAULT_TEST_OPTIONS)
 AC_SUBST(HAVE_SOCKET_WRAPPER)
 AC_SUBST(SOCKET_WRAPPER_OBJS)
diff --git a/source/lib/socket_wrapper/config.mk b/source/lib/socket_wrapper/config.mk
new file mode 100644 (file)
index 0000000..60cfb32
--- /dev/null
@@ -0,0 +1,8 @@
+##############################
+# Start SUBSYSTEM SOCKET_WRAPPER
+[SUBSYSTEM::SOCKET_WRAPPER]
+PRIVATE_DEPENDENCIES = LIBREPLACE_NETWORK
+# End SUBSYSTEM SOCKET_WRAPPER
+##############################
+
+SOCKET_WRAPPER_OBJ_FILES = $(socketwrappersrcdir)/socket_wrapper.o
index d0326be4950cc1bd6a476ed22f40c67275852a34..5ac9965bd6188ee4f1f2015e713375e528aa0eab 100644 (file)
@@ -1289,7 +1289,7 @@ _PUBLIC_ int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
                return -1;
        }
 
-       my_addr = malloc(my_addrlen);
+       my_addr = (struct sockaddr *)malloc(my_addrlen);
        if (my_addr == NULL) {
                return -1;
        }
index fd1e48610b7937dd5b1898958fa05797cfce5bcb..cc8b93760864d69db27ec7f02f2303283b721c94 100644 (file)
@@ -37,6 +37,7 @@
 #define __SOCKET_WRAPPER_H__
 
 const char *socket_wrapper_dir(void);
+unsigned int socket_wrapper_default_iface(void);
 int swrap_socket(int family, int type, int protocol);
 int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
 int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen);
@@ -131,4 +132,5 @@ int swrap_close(int);
 #define close(s)                       swrap_close(s)
 #endif
 
+
 #endif /* __SOCKET_WRAPPER_H__ */
index 65ae9a0584f2b2cfd7a6ed529138848f2f8ca2fe..8877418e4cc46cfac37ca282fc471cc48d7f94c0 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"