obnox/cwrap/socket_wrapper.git
9 years agoTODO re-enable (and fix) commented out udp_bind_in_use_2() test bind
Michael Adam [Thu, 5 Jun 2014 23:21:47 +0000 (01:21 +0200)]
TODO re-enable (and fix) commented out udp_bind_in_use_2() test

9 years agoTODO: tests: binding wildcard after specific now succeeds.
Michael Adam [Thu, 5 Jun 2014 23:20:03 +0000 (01:20 +0200)]
TODO: tests: binding wildcard after specific now succeeds.

9 years agoTODO: tests: make available commented out function in udp_bind test
Michael Adam [Thu, 5 Jun 2014 23:19:39 +0000 (01:19 +0200)]
TODO: tests: make available commented out function in udp_bind test

9 years agoTODO/SQ: swrap check for reuseaddr instead of dgram in in_use check
Michael Adam [Thu, 5 Jun 2014 23:16:29 +0000 (01:16 +0200)]
TODO/SQ: swrap check for reuseaddr instead of dgram in in_use check

9 years agoswrap: store reuseaddr in socket_info in swrap_setsockopt()
Michael Adam [Thu, 5 Jun 2014 23:08:03 +0000 (01:08 +0200)]
swrap: store reuseaddr in socket_info in swrap_setsockopt()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoSQ: tests udp bind fix build
Michael Adam [Thu, 5 Jun 2014 23:07:45 +0000 (01:07 +0200)]
SQ: tests udp bind fix build

9 years agoswrap: add reuseaddr member to struct socket_info
Michael Adam [Thu, 5 Jun 2014 23:01:41 +0000 (01:01 +0200)]
swrap: add reuseaddr member to struct socket_info

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: rename check_addr_port_in_use() -> swrap_check_addr_port_in_use()
Michael Adam [Thu, 5 Jun 2014 23:00:43 +0000 (01:00 +0200)]
swrap: rename check_addr_port_in_use() -> swrap_check_addr_port_in_use()

Signed-off-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>
9 years agoTMP: add TODO.obnox
Michael Adam [Thu, 5 Jun 2014 22:54:27 +0000 (00:54 +0200)]
TMP: add TODO.obnox

9 years agoTMP fix test_udp_bind.c
Michael Adam [Thu, 5 Jun 2014 22:53:22 +0000 (00:53 +0200)]
TMP fix test_udp_bind.c

9 years agoTODO: add commented-out test test_udp_bind_ipv4_addr_in_use_2()
Michael Adam [Thu, 5 Jun 2014 20:45:07 +0000 (22:45 +0200)]
TODO: add commented-out test test_udp_bind_ipv4_addr_in_use_2()

9 years agotests: add test_udp_bind
Michael Adam [Thu, 5 Jun 2014 16:15:42 +0000 (18:15 +0200)]
tests: add test_udp_bind

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: fix binding wildcard and other address on same port for UDP sockets
Michael Adam [Thu, 5 Jun 2014 14:37:49 +0000 (16:37 +0200)]
swrap: fix binding wildcard and other address on same port for UDP sockets

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: allow binding broadcast addresses with same port as unicast
Michael Adam [Wed, 4 Jun 2014 15:01:51 +0000 (17:01 +0200)]
swrap: allow binding broadcast addresses with same port as unicast

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: use torture_client_address() in test_bindresvport_on_ipv6_sock()
Michael Adam [Wed, 4 Jun 2014 10:55:52 +0000 (12:55 +0200)]
tests: use torture_client_address() in test_bindresvport_on_ipv6_sock()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: use torture_client_address() in test_bindresvport_ipv4()
Michael Adam [Wed, 4 Jun 2014 10:55:16 +0000 (12:55 +0200)]
tests: use torture_client_address() in test_bindresvport_ipv4()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: use torture_client_address() in test_bindresvport_on_ipv6_sock()
Michael Adam [Wed, 4 Jun 2014 10:54:08 +0000 (12:54 +0200)]
tests: use torture_client_address() in test_bindresvport_on_ipv6_sock()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: use torture_client_address() in test_bind_ipv4()
Michael Adam [Wed, 4 Jun 2014 10:52:50 +0000 (12:52 +0200)]
tests: use torture_client_address() in test_bind_ipv4()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: use torture_client_port/address in test_bind_ipv4_addr_in_use()
Michael Adam [Wed, 4 Jun 2014 10:51:55 +0000 (12:51 +0200)]
tests: use torture_client_port/address in test_bind_ipv4_addr_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: add test_bind_on_ipv6_sock_addr_in_use()
Michael Adam [Sat, 31 May 2014 11:22:18 +0000 (13:22 +0200)]
tests: add test_bind_on_ipv6_sock_addr_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotorture: add torture_client_port()
Michael Adam [Wed, 4 Jun 2014 07:42:48 +0000 (09:42 +0200)]
torture: add torture_client_port()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotorture: add torture_client_address()
Michael Adam [Wed, 4 Jun 2014 07:42:31 +0000 (09:42 +0200)]
torture: add torture_client_address()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: fix check_addr_port_in_use() check for ipv6 wildcard address
Michael Adam [Tue, 3 Jun 2014 13:39:32 +0000 (15:39 +0200)]
swrap: fix check_addr_port_in_use() check for ipv6 wildcard address

Corresponding to the already existing check vor ipv4.

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: add shortcut for candidate port == 0 in check_addr_port_in_use() - AF_INET6
Michael Adam [Wed, 4 Jun 2014 10:16:40 +0000 (12:16 +0200)]
swrap: add shortcut for candidate port == 0 in check_addr_port_in_use() - AF_INET6

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: add test with initial address INADDR_ANY and port 0 to test_bind_ipv4_addr_in_...
Michael Adam [Wed, 4 Jun 2014 09:14:20 +0000 (11:14 +0200)]
tests: add test with initial address INADDR_ANY and port 0 to test_bind_ipv4_addr_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: fix uses if s/s2 in test_bind_ipv4_addr_in_use()
Michael Adam [Wed, 4 Jun 2014 12:26:24 +0000 (14:26 +0200)]
tests: fix uses if s/s2 in test_bind_ipv4_addr_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: extend test_bind_ipv4_addr_in_use() to use INADDR_ANY as first socket
Michael Adam [Tue, 3 Jun 2014 21:36:36 +0000 (23:36 +0200)]
tests: extend test_bind_ipv4_addr_in_use() to use INADDR_ANY as first socket

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: extend test_bind_ipv4_addr_in_use() to test two different ports != 0
Michael Adam [Tue, 3 Jun 2014 20:53:30 +0000 (22:53 +0200)]
tests: extend test_bind_ipv4_addr_in_use() to test two different ports != 0

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: extend test_bind_ipv4_addr_in_use() to test INADDR_ANY as second address
Michael Adam [Tue, 3 Jun 2014 20:48:31 +0000 (22:48 +0200)]
tests: extend test_bind_ipv4_addr_in_use() to test INADDR_ANY as second address

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agotests: fix comment typo.
Michael Adam [Tue, 3 Jun 2014 20:05:01 +0000 (22:05 +0200)]
tests: fix comment typo.

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: fix fix ipv4 case in check_addr_port_in_use()
Michael Adam [Wed, 4 Jun 2014 05:59:26 +0000 (07:59 +0200)]
swrap: fix fix ipv4 case in check_addr_port_in_use()

To behave like the real world...

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: add shortcut for candidate port == 0 in check_addr_port_in_use() - AF_INET
Michael Adam [Wed, 4 Jun 2014 10:07:38 +0000 (12:07 +0200)]
swrap: add shortcut for candidate port == 0 in check_addr_port_in_use() - AF_INET

Signed-off-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>
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>
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>
9 years agoswrap: fix discard const warnings in check_addr_port_in_use()
Michael Adam [Tue, 3 Jun 2014 19:46:28 +0000 (21:46 +0200)]
swrap: fix discard const warnings in check_addr_port_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: use better variable names in check_addr_port_in_use()
Michael Adam [Tue, 3 Jun 2014 19:42:46 +0000 (21:42 +0200)]
swrap: use better variable names in check_addr_port_in_use()

use "used" and "candidate" instead of "sin1" and "sin2".

Signed-off-by: Michael Adam <obnox@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>
9 years agoswrap: fix HAVE_IPV6 guards in check_addr_port_in_use()
Michael Adam [Wed, 4 Jun 2014 07:36:28 +0000 (09:36 +0200)]
swrap: fix HAVE_IPV6 guards in check_addr_port_in_use()

Signed-off-by: Michael Adam <obnox@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>
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 agoRevert "tests: Disable addr_in_use bind test while the swrap code is incomplete."
Michael Adam [Thu, 5 Jun 2014 22:57:07 +0000 (00:57 +0200)]
Revert "tests: Disable addr_in_use bind test while the swrap code is incomplete."

This reverts commit d768235f48622c89378cb32c48a65ecb97dd2780.

9 years agoRevert "swrap: Disable incomplete bind checks for EADDRINUSE."
Michael Adam [Thu, 5 Jun 2014 22:56:53 +0000 (00:56 +0200)]
Revert "swrap: Disable incomplete bind checks for EADDRINUSE."

This reverts commit 86114df0dfc8d74fc545d08c864f9045c70fe452.

9 years agoBump version to 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.
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>
9 years agotests: greatly extend the ipv4 bind test
Michael Adam [Sat, 31 May 2014 01:31:29 +0000 (03:31 +0200)]
tests: greatly extend the ipv4 bind test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: check whether an address:port is already in use in swrap_bind()
Michael Adam [Fri, 30 May 2014 12:20:40 +0000 (14:20 +0200)]
swrap: check whether an address:port is already in use in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: implement check_addr_port_in_use()
Michael Adam [Fri, 30 May 2014 12:20:17 +0000 (14:20 +0200)]
swrap: implement check_addr_port_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix AF_UNSPEC special case in swrap_bind()
Michael Adam [Fri, 30 May 2014 11:21:00 +0000 (13:21 +0200)]
swrap: fix AF_UNSPEC special case in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: extend input checks in swrap_bind()
Michael Adam [Fri, 30 May 2014 11:06:02 +0000 (13:06 +0200)]
swrap: extend input checks in swrap_bind()

Not only check family, but depending on family, also check the length.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoUpdate the todo list.
Andreas Schneider [Wed, 28 May 2014 08:04:04 +0000 (10:04 +0200)]
Update the todo list.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Avoid using getenv() to retrieve the path.
Andreas Schneider [Wed, 28 May 2014 07:46:57 +0000 (09:46 +0200)]
tests: Avoid using getenv() to retrieve the path.

CID 17221

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: add check for rpc/rpc.h - needed on freebsd for bindresvport
Michael Adam [Sat, 31 May 2014 23:48:15 +0000 (01:48 +0200)]
swrap: add check for rpc/rpc.h - needed on freebsd for bindresvport

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotests: Add tests for bindresvport().
Andreas Schneider [Wed, 28 May 2014 07:46:40 +0000 (09:46 +0200)]
tests: Add tests for bindresvport().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add support for bindresvport().
Andreas Schneider [Tue, 20 May 2014 18:04:02 +0000 (20:04 +0200)]
swrap: Add support for bindresvport().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add tests for bind().
Andreas Schneider [Wed, 21 May 2014 07:15:10 +0000 (09:15 +0200)]
tests: Add tests for bind().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add missing family check in bind().
Andreas Schneider [Wed, 21 May 2014 06:30:53 +0000 (08:30 +0200)]
swrap: Add missing family check in bind().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add test that getsockname is correct after socket().
Andreas Schneider [Tue, 27 May 2014 18:53:51 +0000 (20:53 +0200)]
tests: Add test that getsockname is correct after socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Setup myname in swrap_socket() for getsockname().
Andreas Schneider [Tue, 27 May 2014 18:43:51 +0000 (20:43 +0200)]
swrap: Setup myname in swrap_socket() for getsockname().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotorture: Wait for the pidfile and then start the tests.
Andreas Schneider [Fri, 30 May 2014 11:59:43 +0000 (13:59 +0200)]
torture: Wait for the pidfile and then start the tests.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoecho_srv: Write pidfile after we setup the listeners.
Andreas Schneider [Fri, 30 May 2014 11:57:25 +0000 (13:57 +0200)]
echo_srv: Write pidfile after we setup the listeners.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoREADME.install: improvements and fixes.
Michael Adam [Tue, 27 May 2014 12:05:45 +0000 (14:05 +0200)]
README.install: improvements and fixes.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoAdd README.install - instructions for building and installing.
Michael Adam [Tue, 27 May 2014 05:57:20 +0000 (07:57 +0200)]
Add README.install - instructions for building and installing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotests: Fix possible format string attack.
Andreas Schneider [Tue, 27 May 2014 07:35:00 +0000 (09:35 +0200)]
tests: Fix possible format string attack.

Well, there is really not attack on a test but we want to silence
Coverity :)

CID 17221

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Make sure cmbuf is not NULL.
Andreas Schneider [Tue, 27 May 2014 07:09:24 +0000 (09:09 +0200)]
swrap: Make sure cmbuf is not NULL.

CID 63532

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: We need to pass a pointer-pointer to not leak memory.
Andreas Schneider [Tue, 27 May 2014 07:08:32 +0000 (09:08 +0200)]
swrap: We need to pass a pointer-pointer to not leak memory.

CID 63533

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add more tests for socket options.
Andreas Schneider [Thu, 22 May 2014 09:32:22 +0000 (11:32 +0200)]
tests: Add more tests for socket options.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Support more socket options in getsockopt().
Andreas Schneider [Thu, 22 May 2014 09:18:08 +0000 (11:18 +0200)]
swrap: Support more socket options in getsockopt().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoecho_srv: Add support for IP_SENDSRCADDR.
Andreas Schneider [Fri, 23 May 2014 12:36:23 +0000 (14:36 +0200)]
echo_srv: Add support for IP_SENDSRCADDR.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().
Andreas Schneider [Fri, 23 May 2014 12:35:59 +0000 (14:35 +0200)]
swrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_filter_cmsg_pktinfo().
Andreas Schneider [Fri, 23 May 2014 12:35:34 +0000 (14:35 +0200)]
swrap: Add swrap_msghdr_filter_cmsg_pktinfo().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_sendmsg_filter_cmsg_socket().
Andreas Schneider [Fri, 23 May 2014 13:44:23 +0000 (15:44 +0200)]
swrap: Add swrap_sendmsg_filter_cmsg_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_sendmsg_copy_cmsg().
Andreas Schneider [Fri, 23 May 2014 13:48:33 +0000 (15:48 +0200)]
swrap: Add swrap_sendmsg_copy_cmsg().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_sendmsg_filter_cmsghdr().
Andreas Schneider [Fri, 23 May 2014 13:42:14 +0000 (15:42 +0200)]
swrap: Add swrap_sendmsg_filter_cmsghdr().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoecho_srv: Implement support for IP_RECVDSTADDR on BSD.
Andreas Schneider [Mon, 26 May 2014 09:07:45 +0000 (11:07 +0200)]
echo_srv: Implement support for IP_RECVDSTADDR on BSD.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Implement support for IP_RECVDSTADDR on BSD.
Andreas Schneider [Mon, 26 May 2014 09:00:09 +0000 (11:00 +0200)]
swrap: Implement support for IP_RECVDSTADDR on BSD.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoecho_srv: Fix building on OpenIndiana.
Andreas Schneider [Fri, 23 May 2014 07:26:13 +0000 (09:26 +0200)]
echo_srv: Fix building on OpenIndiana.

Solaris doesn't have support for auxillary messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Check if the in_pktinfo structure is available.
Andreas Schneider [Fri, 23 May 2014 08:01:21 +0000 (10:01 +0200)]
swrap: Check if the in_pktinfo structure is available.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Silence a warning on OpenIndiana.
Andreas Schneider [Fri, 23 May 2014 07:20:31 +0000 (09:20 +0200)]
swrap: Silence a warning on OpenIndiana.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Fix assert_sockaddr_equal() file and line output.
Andreas Schneider [Wed, 21 May 2014 12:52:21 +0000 (14:52 +0200)]
tests: Fix assert_sockaddr_equal() file and line output.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Add some warnings were we should error out.
Andreas Schneider [Fri, 23 May 2014 06:50:47 +0000 (08:50 +0200)]
cmake: Add some warnings were we should error out.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Properly cache the handle also in LIBC_SO case.
Pino Toscano [Thu, 8 May 2014 14:26:43 +0000 (16:26 +0200)]
swrap: Properly cache the handle also in LIBC_SO case.

Small regression introduced by me in commit
0fa56909442c3cfea6a697681ea0e89ba5a0aa0f.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10572

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Fix a typo in socket_wrapper-config.cmake.in.
Andreas Schneider [Thu, 22 May 2014 12:56:09 +0000 (14:56 +0200)]
cmake: Fix a typo in socket_wrapper-config.cmake.in.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Require cmocka versin 0.4.1.
Andreas Schneider [Thu, 22 May 2014 06:49:07 +0000 (08:49 +0200)]
cmake: Require cmocka versin 0.4.1.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add test for different length passed to get(sock|peer)name.
Andreas Schneider [Wed, 14 May 2014 16:08:38 +0000 (18:08 +0200)]
tests: Add test for different length passed to get(sock|peer)name.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Truncate the address if the buffer is to small.
Andreas Schneider [Wed, 14 May 2014 15:44:07 +0000 (17:44 +0200)]
swrap: Truncate the address if the buffer is to small.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add support to sending IP_PKTINFO in echo_srv.
Andreas Schneider [Wed, 14 May 2014 09:28:33 +0000 (11:28 +0200)]
tests: Add support to sending IP_PKTINFO in echo_srv.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add support to receive IP_PKTINFO in echo_srv.
Andreas Schneider [Wed, 14 May 2014 08:11:37 +0000 (10:11 +0200)]
tests: Add support to receive IP_PKTINFO in echo_srv.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Process control messages in recvmsg().
Andreas Schneider [Tue, 13 May 2014 14:06:13 +0000 (16:06 +0200)]
swrap: Process control messages in recvmsg().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().
Andreas Schneider [Tue, 13 May 2014 14:05:44 +0000 (16:05 +0200)]
swrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_socket_info().
Andreas Schneider [Tue, 13 May 2014 14:02:26 +0000 (16:02 +0200)]
swrap: Add swrap_msghdr_socket_info().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_add_pktinfo().
Andreas Schneider [Tue, 13 May 2014 14:01:25 +0000 (16:01 +0200)]
swrap: Add swrap_msghdr_add_pktinfo().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_add_cmsghdr().
Andreas Schneider [Wed, 22 Jan 2014 17:45:51 +0000 (18:45 +0100)]
swrap: Add swrap_msghdr_add_cmsghdr().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>