summaryrefslogtreecommitdiff
path: root/source4/lib/socket
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-03-04 14:07:38 +1100
committerStefan Metzmacher <metze@samba.org>2013-03-04 08:38:23 +0100
commit50b42d1c5bb19e3a5050d7d23ac96e273d3974ee (patch)
tree48b999e948f254c994c1e99a960a34daced3743d /source4/lib/socket
parentb9b637569960ae7eef5ee12436624af34a718a9a (diff)
downloadsamba-50b42d1c5bb19e3a5050d7d23ac96e273d3974ee.tar.gz
samba-50b42d1c5bb19e3a5050d7d23ac96e273d3974ee.tar.bz2
samba-50b42d1c5bb19e3a5050d7d23ac96e273d3974ee.zip
s4-lib/socket: Return the original EMSGSIZE when sendto() and setsockopt() 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>
Diffstat (limited to 'source4/lib/socket')
-rw-r--r--source4/lib/socket/socket_unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/socket/socket_unix.c b/source4/lib/socket/socket_unix.c
index 049e5707c8..0774b12b93 100644
--- a/source4/lib/socket/socket_unix.c
+++ b/source4/lib/socket/socket_unix.c
@@ -295,7 +295,7 @@ static NTSTATUS unixdom_sendto(struct socket_context *sock,
if (setsockopt(sock->fd, SOL_SOCKET, SO_SNDBUF, &bufsize,
sizeof(bufsize)) == -1)
{
- return map_nt_error_from_unix_common(errno);
+ return map_nt_error_from_unix_common(EMSGSIZE);
}
len = sendto(sock->fd, blob->data, blob->length, 0, sa, sa_len);
}