socket_wrapper.git
7 years agoBump version to 1.1.7 socket_wrapper-1.1.7
Andreas Schneider [Fri, 20 May 2016 06:58:18 +0000 (08:58 +0200)]
Bump version to 1.1.7

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agotests: Add test_connect_sendto_null_ipv4() test
Andreas Schneider [Tue, 17 May 2016 08:01:38 +0000 (10:01 +0200)]
tests: Add test_connect_sendto_null_ipv4() test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agotests: Add a udp test case for sendto() after a connect()
Richard Sharpe [Thu, 12 May 2016 00:10:54 +0000 (17:10 -0700)]
tests: Add a udp test case for sendto() after a connect()

Here, we do the same as net ads dns gethostbyname. That is, we
connect on a UDP socket and then send a sendto with a dest address (the
same as the one we connected on.) and then a recvfrom etc.

Signed-of-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoswrap: Fix sendto() with connected sockets
Richard Sharpe [Thu, 12 May 2016 00:03:46 +0000 (17:03 -0700)]
swrap: Fix sendto() with connected sockets

Let the socket wrapper code work with the net ads dns gethostbyname etc
code (lib/addn/dnssock.c) which uses connect on a UDP socket before then
using sendto and recvfrom.

Here, we make sure we don't error out in that case.

Tested by creating a test case for this and then observing that:

1. The test case works when the socket wrapper lib is not being used
   ie, run the test directly after defining some SHELL variables.

2. That the test case fails when run with the un modified socket
   wrapper code.

3. Apply this fix and observe that it runs correctly.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoswrap: Allow to open RAW sockets when loaded
Andreas Schneider [Tue, 26 Apr 2016 16:10:52 +0000 (18:10 +0200)]
swrap: Allow to open RAW sockets when loaded

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agoswrap: Add support for accept4()
Andreas Schneider [Tue, 3 May 2016 12:59:34 +0000 (14:59 +0200)]
swrap: Add support for accept4()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
8 years agoswrap: Add support for running on OpenBSD
Andreas Schneider [Tue, 3 May 2016 12:43:21 +0000 (14:43 +0200)]
swrap: Add support for running on OpenBSD

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
8 years agoBump version to 1.1.6 socket_wrapper-1.1.6
Andreas Schneider [Tue, 15 Mar 2016 10:15:07 +0000 (11:15 +0100)]
Bump version to 1.1.6

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Fix buliding on unix systems without AF_NETLINK
Andreas Schneider [Thu, 25 Feb 2016 17:01:49 +0000 (18:01 +0100)]
swrap: Fix buliding on unix systems without AF_NETLINK

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agoswrap: Use calloc() instead of malloc and memset
Andreas Schneider [Tue, 23 Feb 2016 10:22:58 +0000 (11:22 +0100)]
swrap: Use calloc() instead of malloc and memset

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Allow to open NETLINK sockets when loaded
Andreas Schneider [Thu, 5 Nov 2015 13:44:26 +0000 (14:44 +0100)]
swrap: Allow to open NETLINK sockets when loaded

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Add test for ephemeral port binding in listen()
Andreas Schneider [Wed, 4 Nov 2015 10:22:25 +0000 (11:22 +0100)]
tests: Add test for ephemeral port binding in listen()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Automatically bind an ephemeral port if needed
Andreas Schneider [Wed, 4 Nov 2015 10:21:23 +0000 (11:21 +0100)]
swrap: Automatically bind an ephemeral port if needed

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Add valgrind suppression file for dlopen() issues
Andreas Schneider [Wed, 28 Oct 2015 08:52:25 +0000 (09:52 +0100)]
tests: Add valgrind suppression file for dlopen() issues

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Add a wrapper for write()
Andreas Schneider [Wed, 28 Oct 2015 09:30:32 +0000 (10:30 +0100)]
swrap: Add a wrapper for write()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotorture: Use a short torture socket dir
Andreas Schneider [Tue, 27 Oct 2015 09:03:06 +0000 (10:03 +0100)]
torture: Use a short torture socket dir

This makes sure we do not run into a regression.

Thanks to Grigorij Demidov <grigorii.demidov@nic.cz>

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Fix recvmsg() with UDP
Andreas Schneider [Tue, 27 Oct 2015 08:26:40 +0000 (09:26 +0100)]
swrap: Fix recvmsg() with UDP

This worked if the unix path was bigger than sizeof(struct sockaddr_in6).
With a short unix socket pathname the buffer was to small to store the
address and convert_un_in() failed.

Thanks to Grigorij Demidov <grigorii.demidov@nic.cz>

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Fix compare of signed and unsigned integer expressions
Andreas Schneider [Fri, 16 Oct 2015 14:52:46 +0000 (16:52 +0200)]
swrap: Fix compare of signed and unsigned integer expressions

Make sure the values are compared as the same type. iov_len is size_t on
Linux and int on Solaris.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agotests: Fix compile warning
Andreas Schneider [Fri, 16 Oct 2015 14:50:00 +0000 (16:50 +0200)]
tests: Fix compile warning

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agoBump version to 1.1.5 socket_wrapper-1.1.5
Andreas Schneider [Wed, 14 Oct 2015 09:37:55 +0000 (11:37 +0200)]
Bump version to 1.1.5

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 years agoswrap: Simplify cmspace calculation in swrap_sendmsg_copy_cmsg()
Ralph Boehme [Thu, 8 Oct 2015 01:25:53 +0000 (03:25 +0200)]
swrap: Simplify cmspace calculation in swrap_sendmsg_copy_cmsg()

With cmsg->cmsg_len = CMSG_LEN(len) =>

CMSG_ALIGN(cmsg->cmsg_len) =

CMSG_ALIGN(CMSG_LEN(len)) =

CMSG_ALIGN(CMSG_ALIGN(sizeof(struct cmsghdr)) + len) =

CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len) =

CMSG_SPACE(len) =

CMSG_SPACE(CMSG_ALIGN(sizeof(struct cmsghdr)) + len - CMSG_ALIGN(sizeof(struct cmsghdr))) =

CMSG_SPACE(CMSG_LEN(len) - CMSG_ALIGN(sizeof(struct cmsghdr))) =

CMSG_SPACE(cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)))

:)

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agotests: Add a unit test for wrap_sendmsg_filter_cmsghdr()
Ralph Boehme [Tue, 13 Oct 2015 14:38:26 +0000 (16:38 +0200)]
tests: Add a unit test for wrap_sendmsg_filter_cmsghdr()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agotests: Add test for TCP_NODELAY setsockopt()
Andreas Schneider [Thu, 8 Oct 2015 09:02:10 +0000 (11:02 +0200)]
tests: Add test for TCP_NODELAY setsockopt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agotests: Add test for TCP_NODELAY getsockopt()
Andreas Schneider [Mon, 14 Sep 2015 20:07:09 +0000 (22:07 +0200)]
tests: Add test for TCP_NODELAY getsockopt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoswrap: Add support for TCP_NODELAY in getsockopt()
Andreas Schneider [Mon, 14 Sep 2015 20:06:52 +0000 (22:06 +0200)]
swrap: Add support for TCP_NODELAY in getsockopt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoswrap: Add support for TCP_NODELAY in setsockopt()
Andreas Schneider [Thu, 8 Oct 2015 08:51:02 +0000 (10:51 +0200)]
swrap: Add support for TCP_NODELAY in setsockopt()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoBump version to 1.1.4 socket_wrapper-1.1.4
Andreas Schneider [Mon, 24 Aug 2015 15:53:28 +0000 (17:53 +0200)]
Bump version to 1.1.4

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 years agoswrap: Call dlclose() in the destructor
Andreas Schneider [Mon, 17 Aug 2015 10:14:44 +0000 (12:14 +0200)]
swrap: Call dlclose() in the destructor

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agotests: Rename s_addr to send_addr
Andreas Schneider [Mon, 17 Aug 2015 10:06:30 +0000 (12:06 +0200)]
tests: Rename s_addr to send_addr

The preprocessor on Solaris replaces s_addr with S_un.S_addr.

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agotests: Fix memset() call in new tests
Andreas Schneider [Wed, 12 Aug 2015 06:48:56 +0000 (08:48 +0200)]
tests: Fix memset() call in new tests

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agotests: Fix passing pointer of incompatible type
Andreas Schneider [Wed, 12 Aug 2015 06:37:39 +0000 (08:37 +0200)]
tests: Fix passing pointer of incompatible type

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agoswrap: Fix signed comparsion warnings
Andreas Schneider [Wed, 12 Aug 2015 06:37:07 +0000 (08:37 +0200)]
swrap: Fix signed comparsion warnings

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agoswrap: Add enviornment variable to specify mtu size
Andreas Schneider [Tue, 11 Aug 2015 10:11:16 +0000 (12:11 +0200)]
swrap: Add enviornment variable to specify mtu size

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Add tcp sendmsg/recvmsg test
Andreas Schneider [Tue, 11 Aug 2015 09:40:30 +0000 (11:40 +0200)]
tests: Add tcp sendmsg/recvmsg test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Fix TCP support with sendmsg/recvmsg
Andreas Schneider [Tue, 11 Aug 2015 09:39:52 +0000 (11:39 +0200)]
swrap: Fix TCP support with sendmsg/recvmsg

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Tests for msg_name(len) in sendmsg/revcmsg
Andreas Schneider [Mon, 10 Aug 2015 14:09:16 +0000 (16:09 +0200)]
tests: Tests for msg_name(len) in sendmsg/revcmsg

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Fix testname of sendmsg tests
Andreas Schneider [Mon, 10 Aug 2015 11:39:09 +0000 (13:39 +0200)]
tests: Fix testname of sendmsg tests

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Correctly update the msg_name in recvmsg()
Andreas Schneider [Wed, 5 Aug 2015 13:02:49 +0000 (15:02 +0200)]
swrap: Correctly update the msg_name in recvmsg()

This has been found while debugging nsupdate.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Migrate to new cmocka API
Andreas Schneider [Thu, 6 Aug 2015 14:08:32 +0000 (16:08 +0200)]
tests: Migrate to new cmocka API

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoUpdate TODO
Andreas Schneider [Wed, 15 Jul 2015 13:18:08 +0000 (15:18 +0200)]
Update TODO

9 years agoRegenerate manpage.
Andreas Schneider [Mon, 20 Apr 2015 06:58:00 +0000 (08:58 +0200)]
Regenerate manpage.

Signed-off-by: Andreas Schneider <asn@samba.org>
9 years agodoc: Add a specific date to manpage
Jelmer Vernooij [Sat, 18 Apr 2015 23:58:15 +0000 (23:58 +0000)]
doc: Add a specific date to manpage

This makes builds for socket wrapper reproducible.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agocmake: Drop test results via https.
Andreas Schneider [Wed, 25 Feb 2015 10:11:32 +0000 (11:11 +0100)]
cmake: Drop test results via https.

Signed-off-by: Andreas Schneider <asn@samba.org>
9 years agoBump version to 1.1.3 socket_wrapper-1.1.3
Andreas Schneider [Mon, 23 Feb 2015 14:24:26 +0000 (15:24 +0100)]
Bump version to 1.1.3

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoUpdate ChangeLog
Andreas Schneider [Mon, 23 Feb 2015 14:23:47 +0000 (15:23 +0100)]
Update ChangeLog

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: If we remove the socket_info also unlink the unix socket
Andreas Schneider [Tue, 3 Feb 2015 16:07:18 +0000 (17:07 +0100)]
swrap: If we remove the socket_info also unlink the unix socket

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotorture: Increase time to wait for pid file.
Andreas Schneider [Tue, 16 Dec 2014 14:26:32 +0000 (15:26 +0100)]
torture: Increase time to wait for pid file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Do not leak the socket_info we just removed.
Andreas Schneider [Fri, 24 Oct 2014 09:22:15 +0000 (11:22 +0200)]
swrap: Do not leak the socket_info we just removed.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Treat no_sanitize_address attribute warnings as error.
Andreas Schneider [Thu, 23 Oct 2014 05:23:36 +0000 (07:23 +0200)]
cmake: Treat no_sanitize_address attribute warnings as error.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agosrc: Add support for running with address sanitizer.
Andreas Schneider [Mon, 20 Oct 2014 07:13:36 +0000 (09:13 +0200)]
src: Add support for running with address sanitizer.

It address sanitzer will complain about our hack with variable function
attributes. This disables the checking of it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agotorture: Check the return code of kill().
Andreas Schneider [Thu, 2 Oct 2014 04:28:10 +0000 (06:28 +0200)]
torture: Check the return code of kill().

CID #73654

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agoswrap: Fix the loop for older gcc versions.
Andreas Schneider [Wed, 1 Oct 2014 14:59:29 +0000 (16:59 +0200)]
swrap: Fix the loop for older gcc versions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoBump version to 1.1.2. socket_wrapper-1.1.2
Andreas Schneider [Wed, 1 Oct 2014 10:56:21 +0000 (12:56 +0200)]
Bump version to 1.1.2.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Add support for eventfd with unsigned count variable.
Andreas Schneider [Wed, 1 Oct 2014 10:51:56 +0000 (12:51 +0200)]
swrap: Add support for eventfd with unsigned count variable.

The prototype in glibc 2.20.90 changed.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Add a trace message for swrap_socket().
Andreas Schneider [Wed, 1 Oct 2014 10:48:13 +0000 (12:48 +0200)]
swrap: Add a trace message for swrap_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Implement fcntl() to catch F_DUPFD.
Andreas Schneider [Thu, 11 Sep 2014 08:17:06 +0000 (10:17 +0200)]
swrap: Implement fcntl() to catch F_DUPFD.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Include the function name in the debug output.
Andreas Schneider [Thu, 11 Sep 2014 06:30:04 +0000 (08:30 +0200)]
swrap: Include the function name in the debug output.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotests: Add missing breaks in sockaddr assert functions.
Andreas Schneider [Wed, 3 Sep 2014 07:04:02 +0000 (09:04 +0200)]
tests: Add missing breaks in sockaddr assert functions.

CID #72657
CID #72656

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix out of bound access.
Andreas Schneider [Wed, 3 Sep 2014 06:59:26 +0000 (08:59 +0200)]
swrap: Fix out of bound access.

CID #72659

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotests: Pass the sockaddr structure to system functions.
Andreas Schneider [Tue, 2 Sep 2014 10:17:15 +0000 (12:17 +0200)]
tests: Pass the sockaddr structure to system functions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoecho_srv: Silence alignment warnings.
Andreas Schneider [Tue, 2 Sep 2014 10:13:25 +0000 (12:13 +0200)]
echo_srv: Silence alignment warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Silence alignment warnings.
Andreas Schneider [Tue, 2 Sep 2014 10:00:13 +0000 (12:00 +0200)]
swrap: Silence alignment warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix type punning warnings when loading functions.
Andreas Schneider [Tue, 2 Sep 2014 09:55:58 +0000 (11:55 +0200)]
swrap: Fix type punning warnings when loading functions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix access to struct members in log messages.
Andreas Schneider [Tue, 2 Sep 2014 09:16:04 +0000 (11:16 +0200)]
swrap: Fix access to struct members in log messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix whitespace errors.
Andreas Schneider [Mon, 1 Sep 2014 07:17:06 +0000 (09:17 +0200)]
swrap: Fix whitespace errors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Update copyright notice.
Andreas Schneider [Fri, 29 Aug 2014 11:12:58 +0000 (13:12 +0200)]
swrap: Update copyright notice.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Wrap fopen to detect stale file descriptors.
Andreas Schneider [Wed, 27 Aug 2014 14:00:43 +0000 (16:00 +0200)]
swrap: Wrap fopen to detect stale file descriptors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Use swrap_address in swrap_accept().
Andreas Schneider [Wed, 21 May 2014 13:14:56 +0000 (15:14 +0200)]
swrap: Use swrap_address in swrap_accept().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Remove unused sockaddr_dup() function.
Andreas Schneider [Wed, 21 May 2014 13:15:38 +0000 (15:15 +0200)]
swrap: Remove unused sockaddr_dup() function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Use swrap_address in the socket_info struct.
Andreas Schneider [Wed, 21 May 2014 12:56:35 +0000 (14:56 +0200)]
swrap: Use swrap_address in the socket_info struct.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Use a sockaddr_un for the unix path in socket_info.
Andreas Schneider [Wed, 21 May 2014 12:06:05 +0000 (14:06 +0200)]
swrap: Use a sockaddr_un for the unix path in socket_info.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_pcap_dump_packet().
Andreas Schneider [Wed, 21 May 2014 09:01:46 +0000 (11:01 +0200)]
swrap: Rename swrap_pcap_dump_packet().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_pcap_get_fd().
Andreas Schneider [Wed, 21 May 2014 08:59:29 +0000 (10:59 +0200)]
swrap: Rename swrap_pcap_get_fd().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_marshall_packet().
Andreas Schneider [Wed, 21 May 2014 08:58:48 +0000 (10:58 +0200)]
swrap: Rename swrap_marshall_packet().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_packet_init().
Andreas Schneider [Wed, 21 May 2014 08:57:36 +0000 (10:57 +0200)]
swrap: Rename swrap_packet_init().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename socket_wrapper_pcap_file().
Andreas Schneider [Wed, 21 May 2014 08:55:48 +0000 (10:55 +0200)]
swrap: Rename socket_wrapper_pcap_file().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoecho_srv: Fix type punning warnings.
Andreas Schneider [Fri, 29 Aug 2014 15:37:51 +0000 (17:37 +0200)]
echo_srv: Fix type punning warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotests: Fix type punning warnings.
Andreas Schneider [Fri, 29 Aug 2014 08:33:16 +0000 (10:33 +0200)]
tests: Fix type punning warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix type punning warnings.
Andreas Schneider [Fri, 29 Aug 2014 08:25:51 +0000 (10:25 +0200)]
swrap: Fix type punning warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agocmake: Set strict aliasing and strict overflow checks.
Andreas Schneider [Thu, 28 Aug 2014 13:22:35 +0000 (15:22 +0200)]
cmake: Set strict aliasing and strict overflow checks.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoAdd #define __APPLE_USE_RFC_3542 to CFLAGS
Jakub Hrozek [Tue, 29 Jul 2014 06:19:34 +0000 (08:19 +0200)]
Add #define __APPLE_USE_RFC_3542 to CFLAGS

Unless __APPLE_USE_RFC_3542 is defined on OSX, constants from RFC 3542
such as IPV6_RECVPKTINFO are not usable.

The patch adds the #define unconditionally -- on other platforms, the
constant is harmless.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoDefine _GNU_SOURCE on one place only.
Jakub Hrozek [Wed, 13 Aug 2014 07:44:30 +0000 (09:44 +0200)]
Define _GNU_SOURCE on one place only.

There were several _GNU_SOURCE definitions scaterred in the build
system. This patch always adds -D_GNU_SOURCE to the CFLAGS if building
on a UNIX platform.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoProvide a compatible declaration of CMSG_ALIGN
Jakub Hrozek [Thu, 3 Jul 2014 21:13:29 +0000 (23:13 +0200)]
Provide a compatible declaration of CMSG_ALIGN

Some platforms (like OSX) do support some of the CMGS macros, but don't
have a CMSG_ALIGN macro of their own.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoSO_PROTOCOL is platform-dependent
Jakub Hrozek [Tue, 1 Jul 2014 22:01:04 +0000 (00:01 +0200)]
SO_PROTOCOL is platform-dependent

SO_PROTOCOL is not defined on all platforms. In particular, OSX doesn't
include it and so far I haven't found any compatible declaration.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: fix another discard const warning in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 19:50:11 +0000 (21:50 +0200)]
swrap: fix another discard const warning in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix discard const warning in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 19:49:12 +0000 (21:49 +0200)]
swrap: fix discard const warning in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix discard const warning in swrap_remove_stale()
Michael Adam [Tue, 3 Jun 2014 19:48:01 +0000 (21:48 +0200)]
swrap: fix discard const warning in swrap_remove_stale()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix build when neither HAVE_STRUCT_IN_PKTINFO nor IP_RECVDSTADDR is defined
Michael Adam [Tue, 3 Jun 2014 13:52:43 +0000 (15:52 +0200)]
swrap: fix build when neither HAVE_STRUCT_IN_PKTINFO nor IP_RECVDSTADDR is defined

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotorture: add HAVE_IPV6 guard to torture_server_address()
Michael Adam [Wed, 4 Jun 2014 07:35:02 +0000 (09:35 +0200)]
torture: add HAVE_IPV6 guard to torture_server_address()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agocmake: Add more build warnings and errors.
Andreas Schneider [Tue, 3 Jun 2014 13:52:43 +0000 (15:52 +0200)]
cmake: Add more build warnings and errors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agofix .gitignore for vi backup files
Michael Adam [Thu, 5 Jun 2014 22:55:11 +0000 (00:55 +0200)]
fix .gitignore for vi backup files

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agodoc: Add a socket_wrapper manpage.
Andreas Schneider [Wed, 9 Jul 2014 08:15:30 +0000 (10:15 +0200)]
doc: Add a socket_wrapper manpage.

9 years agoBump version to 1.1.1 socket_wrapper-1.1.1
Andreas Schneider [Thu, 5 Jun 2014 21:41:09 +0000 (23:41 +0200)]
Bump version to 1.1.1

9 years agoswrap: Disable incomplete bind checks for EADDRINUSE.
Andreas Schneider [Thu, 5 Jun 2014 21:47:40 +0000 (23:47 +0200)]
swrap: Disable incomplete bind checks for EADDRINUSE.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Disable addr_in_use bind test while the swrap code is incomplete.
Andreas Schneider [Thu, 5 Jun 2014 21:46:31 +0000 (23:46 +0200)]
tests: Disable addr_in_use bind test while the swrap code is incomplete.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoBump version to 1.1.0. socket_wrapper-1.1.0
Andreas Schneider [Mon, 2 Jun 2014 12:39:04 +0000 (14:39 +0200)]
Bump version to 1.1.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Fix conflicting variable name on Solaris.
Andreas Schneider [Mon, 2 Jun 2014 06:36:49 +0000 (08:36 +0200)]
tests: Fix conflicting variable name on Solaris.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Fix building without bindresvport().
Andreas Schneider [Mon, 2 Jun 2014 06:30:50 +0000 (08:30 +0200)]
tests: Fix building without bindresvport().

This fixes the build on Solaris.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: add new test test_bind_ipv4_addr_in_use()
Michael Adam [Sat, 31 May 2014 01:35:22 +0000 (03:35 +0200)]
tests: add new test test_bind_ipv4_addr_in_use()

This tests binding an address that is already in use.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotests: extend the ipv6 bind test
Michael Adam [Sat, 31 May 2014 01:31:56 +0000 (03:31 +0200)]
tests: extend the ipv6 bind test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>