aboutsummaryrefslogtreecommitdiff
path: root/net/samba411/files/patch-listen-backlog
blob: b963d45d6966886d9f215cef6d08583694a6e0ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
--- lib/tevent/echo_server.c.orig	2019-01-15 10:07:00 UTC
+++ lib/tevent/echo_server.c
@@ -633,7 +633,7 @@ int main(int argc, const char **argv)
 		exit(1);
 	}
 
-	ret = listen(listen_sock, 5);
+	ret = listen(listen_sock, DEFAULT_LISTEN_BACKLOG);
 	if (ret == -1) {
 		perror("listen() failed");
 		exit(1);
--- source3/include/local.h.orig	2019-01-15 10:07:00 UTC
+++ source3/include/local.h
@@ -173,7 +173,18 @@
 #define WINBIND_SERVER_MUTEX_WAIT_TIME (( ((NUM_CLI_AUTH_CONNECT_RETRIES) * ((CLI_AUTH_TIMEOUT)/1000)) + 5)*2)
 
 /* size of listen() backlog in smbd */
+#if defined (FREEBSD)
+#define SMBD_LISTEN_BACKLOG -1
+#else 
 #define SMBD_LISTEN_BACKLOG 50
+#endif
+
+/* size of listen() default backlog */
+#if defined (FREEBSD)
+#define DEFAULT_LISTEN_BACKLOG -1
+#else
+#define DEFAULT_LISTEN_BACKLOG 5
+#endif
 
 /* Number of microseconds to wait before a sharing violation. */
 #define SHARING_VIOLATION_USEC_WAIT 950000
--- source3/libsmb/unexpected.c.orig	2019-01-15 10:07:00 UTC
+++ source3/libsmb/unexpected.c
@@ -95,7 +95,7 @@ NTSTATUS nb_packet_server_create(TALLOC_
 		status = map_nt_error_from_unix(errno);
 		goto fail;
 	}
-	rc = listen(result->listen_sock, 5);
+	rc = listen(result->listen_sock, DEFAULT_LISTEN_BACKLOG);
 	if (rc < 0) {
 		status = map_nt_error_from_unix(errno);
 		goto fail;
--- source3/rpc_server/rpc_server.c.orig	2019-01-15 10:07:00 UTC
+++ source3/rpc_server/rpc_server.c
@@ -158,7 +158,7 @@ bool setup_named_pipe_socket(const char 
 		goto out;
 	}
 
-	rc = listen(state->fd, 5);
+	rc = listen(state->fd, DEFAULT_LISTEN_BACKLOG);
 	if (rc < 0) {
 		DEBUG(0, ("Failed to listen on pipe socket %s: %s\n",
 			  pipe_name, strerror(errno)));
@@ -830,7 +830,7 @@ bool setup_dcerpc_ncalrpc_socket(struct 
 		goto out;
 	}
 
-	rc = listen(state->fd, 5);
+	rc = listen(state->fd, DEFAULT_LISTEN_BACKLOG);
 	if (rc < 0) {
 		DEBUG(0, ("Failed to listen on ncalrpc socket %s: %s\n",
 			  name, strerror(errno)));
--- source3/utils/smbfilter.c.orig	2019-01-15 10:07:00 UTC
+++ source3/utils/smbfilter.c
@@ -291,7 +291,7 @@ static void start_filter(char *desthost)
 		exit(1);
 	}
 
-	if (listen(s, 5) == -1) {
+	if (listen(s, DEFAULT_LISTEN_BACKLOG) == -1) {
 		d_printf("listen failed\n");
 	}
 
--- source3/winbindd/winbindd.c.orig	2019-01-15 10:07:00 UTC
+++ source3/winbindd/winbindd.c
@@ -1317,7 +1317,7 @@ static bool winbindd_setup_listeners(voi
 	if (pub_state->fd == -1) {
 		goto failed;
 	}
-	rc = listen(pub_state->fd, 5);
+	rc = listen(pub_state->fd, DEFAULT_LISTEN_BACKLOG);
 	if (rc < 0) {
 		goto failed;
 	}
@@ -1349,7 +1349,7 @@ static bool winbindd_setup_listeners(voi
 	if (priv_state->fd == -1) {
 		goto failed;
 	}
-	rc = listen(priv_state->fd, 5);
+	rc = listen(priv_state->fd, DEFAULT_LISTEN_BACKLOG);
 	if (rc < 0) {
 		goto failed;
 	}