summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/socket/socket.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c
index dd3175468d..39379be678 100644
--- a/source4/lib/socket/socket.c
+++ b/source4/lib/socket/socket.c
@@ -69,6 +69,12 @@ static NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socket_
(*new_sock)->flags |= SOCKET_FLAG_TESTNONBLOCK;
}
+ /* we don't do a connect() on dgram sockets, so need to set
+ non-blocking at socket create time */
+ if (!(flags & SOCKET_FLAG_BLOCK) && type == SOCKET_TYPE_DGRAM) {
+ set_blocking(socket_get_fd(*new_sock), False);
+ }
+
talloc_set_destructor(*new_sock, socket_destructor);
return NT_STATUS_OK;