summaryrefslogtreecommitdiffstats
path: root/source4/lib/socket
Commit message (Collapse)AuthorAgeFilesLines
* Update mailing list references to point at lists.samba.orgAndrew Bartlett2015-02-101-1/+1
| | | | | | | | | | | | The mailing lists are on lists.samba.org, but there are many references that use the shorthand of samba.org Some references to samba@ have been changed to samba-technical@ where this make more sense. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Feb 10 07:08:28 CET 2015 on sn-devel-104
* s4:lib/tests: add missing #include "torture/local/proto.h"Stefan Metzmacher2014-04-021-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:lib/socket: simplify iface_list_wildcard() and its callersStefan Metzmacher2014-03-071-2/+2
| | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464 Signed-off-by: Stefan Metzmacher <metze@samba.org> Change-Id: Ib317d71dea01fc8ef6b6a26455f15a8a175d59f6 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Mar 7 02:18:17 CET 2014 on sn-devel-104
* s4:lib/socket: use the same logic in iface_list_wildcard() as in smbdStefan Metzmacher2014-03-071-21/+5
| | | | | | | | | | If we have ipv6 support we should listen on "::" too. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464 Signed-off-by: Stefan Metzmacher <metze@samba.org> Change-Id: I8ce185d5070280149bee9fd33010443be9031089 Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4-lib/socket: Allocate a the larger sockaddr_un and not just a sockaddr_in ↵Stefan Metzmacher2013-07-241-2/+2
| | | | | | | | | | | | | | | | | | in unixdom_get_my_addr() This caused crashes in _tsocket_address_bsd_from_sockaddr() when we read past the end of the allocation. (similar to commit e9ae36e9683372b86f1efbd29904722a33fea083) Bug: https://bugzilla.samba.org/show_bug.cgi?id=10042 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Jul 24 14:37:43 CEST 2013 on sn-devel-104
* s4-lib/socket: Allocate a the larger sockaddr_un and not just a sockaddr_in ↵Andrew Bartlett2013-07-231-2/+2
| | | | | | | | | | | | in unixdom_get_peer_addr() This caused crashes in _tsocket_address_bsd_from_sockaddr() when we read past the end of the allocation. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-lib/socket: Return the original EMSGSIZE when sendto() and setsockopt() ↵Andrew Bartlett2013-03-041-1/+1
| | | | | | | | | | | | | | | | both fail This ensures that should we be unable to increase the socket size, we return an error that the application layer above might expect and be able to make as reasonable response to (such as switching to a stream-based transport). This fixes up c692bb02b039ae8fef6ba968fd13b36ad7d62a72. As suggested by metze in https://bugzilla.samba.org/show_bug.cgi?id=9697#c4 Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Handle EMSGSIZE on UNIX domain sockets.Landon Fuller2013-03-021-9/+26
| | | | | | | | | | | | | | | | | | | | | | On some systems (eg, FreeBSD) the default SO_SNDBUF for UNIX domain sockets is to small, and EMSGSIZE is returned. Other systems provide a larger default send buffer, but there is still no guarantee that the buffer will be sized appropriately. This patch modifies the sendto() path to attempt to resize the SO_SNDBUF dynamically upon an EMSGSIZE failure, and then retry the send. This fixes local DCE/RPC errors on FreeBSD, eg: https://lists.samba.org/archive/samba-technical/2013-January/089881.html Signed-Off-By: Landon Fuller <landonf@bikemonkey.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 23:34:03 CET 2013 on sn-devel-104
* s4-socket: Make sure unix socket addresses are null terminated.Andreas Schneider2012-12-121-5/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* lib/param: Remove use of lp{cfg,}_socket_address outside the NBT client and ↵Andrew Bartlett2012-07-271-10/+0
| | | | | | | | | server In these other cases, control of the sockets to bind to can be obtained using "bind interfaces only = yes" and "interfaces = ". Andrew Bartlett
* s3: Fix the clustering buildVolker Lendecke2011-12-172-4/+4
| | | | | | | ctdb_private.h already defines set_close_on_exec. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sat Dec 17 18:41:39 CET 2011 on sn-devel-104
* s4-socket: use set_close_on_exec()Andrew Tridgell2011-12-152-0/+8
| | | | this prevents a fd leak to child processes
* s4:lib/socket: add socket_connect_multi_ex_*Stefan Metzmacher2011-11-302-10/+147
| | | | | | | | | | | | This add an async establish hook, that gets called before a connection success is detected. This can be used to do a NBT session request and it makes sure that we don't cancel the connection on port 445, just because the tcp connect on port 139 worked. metze
* s4-socket: allow connect_multi_next_socket to try all the IP for a given hostMatthieu Patou2011-11-111-12/+21
| | | | | | This fix an incorrect behavior which was that if a host has 2 IP but was listening on only 1 (and the second one) connect_multi_next_socket was not able to connect because it used only the first result.
* s4-socket: detect NULL server in socket connection codeAndrew Tridgell2011-11-101-0/+5
| | | | | | return NT_STATUS_NOT_FOUND instead of a segfault Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
* s4-socket: do not segfault if the socket is NULLMatthieu Patou2011-11-011-0/+3
| | | | | Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Tue Nov 1 19:02:52 CET 2011 on sn-devel-104
* s4:lib/socket: don't pass -1 to close()Stefan Metzmacher2011-10-311-1/+4
| | | | metze
* s4-interfaces: allow pure ipv6 to workMatthieu Patou2011-10-161-1/+2
| | | | | This is the complementary part of patch abe5afc580dcaaab70f136904d98fa83bfae7b6e for samba4.
* s4:lib/socket/interface.c - "ifaces" strictly needs to be initialisedMatthias Dieter Wallnöfer2011-09-121-1/+1
| | | | | | | | | | | | Please consider a failing "get_interfaces" call and the "talloc_free()" operation on a possible uninitialised "ifaces" on line 326. https://bugzilla.samba.org/show_bug.cgi?id=8397 Reviewed-by: Jelmer Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Mon Sep 12 23:49:12 CEST 2011 on sn-devel-104
* s4:lib: use tevent_ fns names instead of legcay event_ onesSimo Sorce2011-08-132-3/+3
|
* cli_composite: Lowercase name.Jelmer Vernooij2011-07-261-1/+1
|
* s4:lib/socket: iface_list_wildcard() should only return "::" if we have ipv6 ↵Stefan Metzmacher2011-07-101-1/+13
| | | | | | | | | interfaces If glibc has IPv6 support, but it's not enabled in the running kernel we should not try to listen on "::". metze
* libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbolAndrew Bartlett2011-06-203-38/+38
| | | | | | | | | | | | The two error tables need to be combined, but for now seperate the names. (As the common parts of the tree now use the _common function, errmap_unix.c must be included in the s3 autoconf build). Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
* s4-interface: raise the debug level for interface discoveryAndrew Tridgell2011-06-081-3/+3
|
* s4-ipv6: fixed iface_list_same_net() for IPv6Andrew Tridgell2011-06-071-3/+15
|
* s4-ipv6: fix iface_list_best_ip() for IPv6Andrew Tridgell2011-06-071-1/+23
| | | | return an interface with the same address family as the target
* s4-ipv6: fill in family when initialising from sockaddrAndrew Tridgell2011-06-061-1/+13
| | | | | Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Mon Jun 6 05:35:36 CEST 2011 on sn-devel-104
* s4-ipv6: fix the address family for IPv6 string addressesAndrew Tridgell2011-06-061-0/+5
|
* s4-ipv6: use the server address familyAndrew Tridgell2011-06-061-1/+1
| | | | don't force v4 in connect_multi
* s4-ipv6: enable IPv6 by defaultAndrew Tridgell2011-06-061-2/+2
| | | | it now passes all tests
* s4-ipv6: update callers to load_interface_list()Andrew Tridgell2011-06-061-2/+2
|
* s4-ipv6: allow ipv6 to be enabled/disabled in smb.confAndrew Tridgell2011-06-061-11/+20
| | | | | | | this adds the parametric option ipv6:enable=true/false It defaults to false for now, until the remaining issues with testing of ipv6 are resolved
* s4-ipv6: fixed ipv6_listen() to use IPV6_V6ONLYAndrew Tridgell2011-06-061-4/+24
| | | | | this changes ipv6_listen() to use IPV6_V6ONLY, and to setup the right scope id for link local IPv6 addresses
* s4-ipv6: added socket_address_from_sockaddr_storage()Andrew Tridgell2011-06-062-0/+48
| | | | this converts a struct sockaddr_storage to a struct socket_address
* s4-ipv6: added ipv4 functions to interface codeAndrew Tridgell2011-06-061-0/+32
| | | | | this adds iface_list_first_v4() and iface_list_n_is_v4(). The NBT server will use these to allow it to listen only for IPv4 addresses.
* s4-ipv6: fixed a warningAndrew Tridgell2011-06-061-1/+1
|
* s4-ipv6: allow IPv6 addresses in our interfaces listAndrew Tridgell2011-06-061-5/+0
|
* s4-ipv6: added iface_list_wildcard()Andrew Tridgell2011-06-062-1/+29
| | | | | | | | | this returns a list of wildcard address to listen on, when we don't have 'bind interfaces only' set. It is a list, not a single address, we need to listen separately for the IPv6 "::" address from the IPv4 0.0.0.0 address. This also takes account of the loadparm "socket address" option
* lib/util/time.c: timeval_current_ofs_usecRusty Russell2011-06-011-1/+1
| | | | | | | | | | | | | | | Several places want "microseconds from current time", and several were simply handing "usecs" values which could be over a million. Using a helper to do this is safer and more readable. I didn't replace any obviously correct callers (ie. constants). I also renamed wait_nsec in source3/lib/util_sock.c; it's actually microseconds not nanoseconds (introduced with this code in Volker's 19b783cc Async wrapper for open_socket_out_send/recv). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s4-interfaces: keep interfaces in the order they were declaredAndrew Tridgell2011-05-081-1/+5
| | | | | | | | | the spoolss notify test depends on the interfaces order Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Sun May 8 13:57:58 CEST 2011 on sn-devel-104
* s4-interfaces Rename interfaces code so not to conflict with source3/Andrew Bartlett2011-05-082-23/+23
| | | | | | | | | The iface_count, iface_n_bcast, and load_interfaces functions conflicted with functions of the same name in source3, so the source4 functions were renamed. Hopefully we can actually wrap one around the other in future. Andrew Bartlett
* lib/socket move interfaces code to the top levelAndrew Bartlett2011-05-083-334/+6
|
* s4-lib/socket Samba4 is not IPv6 compatibleAndrew Bartlett2011-05-081-0/+5
| | | | | | | | | Don't add IPv6 interfaces until we actually support them. I'll soon have IPv6 service at home, and then I'll make it my buisness to sort this out once and for all. Andrew Bartlett
* s4-lib merge get_interfaces() from Samba3 to Samba4Andrew Bartlett2011-05-083-100/+375
|
* s4-socket: rename allow_access() to socket_allow_access()Andrew Tridgell2011-05-032-7/+7
| | | | | | this prevents a symbol collision with s3 Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* lib/util Move set_socket_options() into common code.Andrew Bartlett2011-05-031-160/+0
|
* s4-lib/socket Merge updated set_socket_options from Samba3 -> Samba4Andrew Bartlett2011-05-031-34/+90
|
* source4/lib: Fix prototypes for all functions.Jelmer Vernooij2011-03-192-0/+4
|
* s4:lib/socket: use sockaddr_in6 in ipv6_tcp_accept()Stefan Metzmacher2011-03-091-1/+1
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Mar 9 14:36:42 CET 2011 on sn-devel-104
* s4-smbtorture: Make test names lowercase and dot-separated.Jelmer Vernooij2010-12-111-2/+1
| | | | | | | | This is consistent with the test names used by selftest, should make the names less confusing and easier to integrate with other tools. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104