diff options
Diffstat (limited to 'source4/lib/socket/socket_ipv4.c')
-rw-r--r-- | source4/lib/socket/socket_ipv4.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/lib/socket/socket_ipv4.c b/source4/lib/socket/socket_ipv4.c index 4de0d8cebe..71e1c62235 100644 --- a/source4/lib/socket/socket_ipv4.c +++ b/source4/lib/socket/socket_ipv4.c @@ -141,6 +141,14 @@ static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_conte return map_nt_error_from_unix(errno); } + if (!(flags & SOCKET_FLAG_BLOCK)) { + int ret = set_blocking(new_fd, False); + if (ret == -1) { + close(new_fd); + return map_nt_error_from_unix(errno); + } + } + /* TODO: we could add a 'accept_check' hook here * which get the black/white lists via socket_set_accept_filter() * or something like that |