summaryrefslogtreecommitdiffstats
path: root/tests/echo_srv.c
Commit message (Collapse)AuthorAgeFilesLines
* echo_srv: Check for a valid pidfile pointerAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Only use 128K as buffer size instead of 4MBAndreas Schneider2018-10-231-1/+1
| | | | | | | This produced errors built with clang. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Do not close bogus file descriptorsAndreas Schneider2018-10-231-4/+2
| | | | | | | | | | | | | | ==1564== Warning: invalid file descriptor 1048564 in syscall close() ==1564== at 0x4D18534: close (in /lib64/libc-2.27.so) ==1564== by 0x4046A74: libc_close (socket_wrapper.c:760) ==1564== by 0x405105C: swrap_close (socket_wrapper.c:5933) ==1564== by 0x40511F5: close (socket_wrapper.c:5979) ==1564== by 0x401679: become_daemon (echo_srv.c:202) ==1564== by 0x402D44: main (echo_srv.c:896) ==1563== Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Avoid -Wcast-align warningAnoop C S2018-10-231-28/+18
| | | | | | | | | | | | | | | warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4 [-Wcast-align] struct sockaddr_in *sinp = (struct sockaddr_in *)to; ^~~~~~~~~~~~~~~~~~~~~~~~ Above warning can be avoided by making use of sockaddr_in available within torture_address from the caller of echo_udp_recv_from_to(). Following that sa_socklen from torture_address can be used instead of passing sa_socklen explicitly to echo_udp_recv_from_to(). Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Prevent child process falling to defunct stateAnoop C S2018-08-091-0/+2
| | | | | | | | | | | | Parent process does not wait for child process(which gets forked after accepting a client connection) to exit inside echo server which in turn puts child into defunct state. Even though those defunct childs are cleaned up during parent exit it is better to wait from parent process itself. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* tests: Fix resouce leak in echo_srv tcp handlingAndreas Schneider2018-05-041-2/+1
| | | | | | | CID 175587 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Modify echo server to accept multiple connectionsAnoop C S2018-05-021-23/+35
| | | | | | | | | | In context of multiple threads, echo server must be capable of accepting connections in a loop rather than be satisfied with one incoming connection. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* echo_srv: Silence alignment warnings.Andreas Schneider2014-09-021-4/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* echo_srv: Fix type punning warnings.Andreas Schneider2014-09-011-88/+86
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* echo_srv: Write pidfile after we setup the listeners.Andreas Schneider2014-05-311-9/+11
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* echo_srv: Add support for IP_SENDSRCADDR.Andreas Schneider2014-05-261-5/+13
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* echo_srv: Implement support for IP_RECVDSTADDR on BSD.Andreas Schneider2014-05-261-14/+52
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* swrap: Implement support for IP_RECVDSTADDR on BSD.Andreas Schneider2014-05-261-5/+1
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* echo_srv: Fix building on OpenIndiana.Andreas Schneider2014-05-261-7/+33
| | | | | | | Solaris doesn't have support for auxillary messages. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Check if the in_pktinfo structure is available.Andreas Schneider2014-05-261-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add support to sending IP_PKTINFO in echo_srv.Andreas Schneider2014-05-221-3/+88
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Michael Adam <obnox@samba.org>
* tests: Add support to receive IP_PKTINFO in echo_srv.Andreas Schneider2014-05-221-5/+194
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Michael Adam <obnox@samba.org>
* echo_srv: Fix possible resouce leaks on error in socket_dup().Andreas Schneider2014-04-251-0/+8
| | | | | | | CID: #17217 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* echo_srv: Improve reopening low fds.Andreas Schneider2014-04-141-7/+16
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
* echo_srv: Don't leak client_sock on failures in echo_tcpJakub Hrozek2014-04-141-8/+9
| | | | | | Signed-off-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* echo_srv: Fix resource leak of fd in pidfile().Andreas Schneider2014-04-141-3/+10
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
* echo_srv: Fix resource leak of s2 on error.Andreas Schneider2014-04-141-1/+1
| | | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
* echo_srv: Fix resource leak of sock.Andreas Schneider2014-04-141-0/+1
| | | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
* echo_srv: Add fd duplication and test it works.Andreas Schneider2013-12-241-4/+206
|
* echo_srv: Add missing includes.Andreas Schneider2013-12-201-7/+11
| | | | This should fix the build on FreeBSD.
* echo_srv: Fix a build warning.Andreas Schneider2013-12-121-1/+1
|
* tests: use discard_const to get rid of a warning on SolarisJakub Hrozek2013-12-111-7/+15
|
* tests: Fix the help output of the echo serverJakub Hrozek2013-12-101-2/+9
|
* tests: Add a simple echo serverJakub Hrozek2013-12-101-0/+330