summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2012-10-20 12:53:14 +0000
committerandre <andre@FreeBSD.org>2012-10-20 12:53:14 +0000
commit1211b4598c3a9281bc1c7e32d0f2a1d8d3978e81 (patch)
treee8ac57bd1fea9f0ae5e1269e803ea8e05943f9ca /sys/kern/uipc_socket.c
parent807619d8ba02bf7ff65a4c57aa6a00f2a2094b97 (diff)
downloadFreeBSD-src-1211b4598c3a9281bc1c7e32d0f2a1d8d3978e81.zip
FreeBSD-src-1211b4598c3a9281bc1c7e32d0f2a1d8d3978e81.tar.gz
Hide the unfortunate named sysctl kern.ipc.somaxconn from sysctl -a
output and replace it with a new visible sysctl kern.ipc.acceptqueue of the same functionality. It specifies the maximum length of the accept queue on a listen socket. The old kern.ipc.somaxconn remains available for reading and writing for compatibility reasons so that existing programs, scripts and configurations continue to work. There no plans to ever remove the orginal and now hidden kern.ipc.somaxconn.
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 6b5581f..a964cf2 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -185,6 +185,8 @@ MALLOC_DEFINE(M_PCB, "pcb", "protocol control block");
/*
* Limit on the number of connections in the listen queue waiting
* for accept(2).
+ * NB: The orginal sysctl somaxconn is still available but hidden
+ * to prevent confusion about the actually purpose of this number.
*/
static int somaxconn = SOMAXCONN;
@@ -205,9 +207,13 @@ sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
somaxconn = val;
return (0);
}
-SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, CTLTYPE_UINT | CTLFLAG_RW,
+SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, CTLTYPE_UINT | CTLFLAG_RW,
0, sizeof(int), sysctl_somaxconn, "I",
"Maximum listen socket pending connection accept queue size");
+SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn,
+ CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP,
+ 0, sizeof(int), sysctl_somaxconn, "I",
+ "Maximum listen socket pending connection accept queue size (compat)");
static int numopensockets;
SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD,
OpenPOWER on IntegriCloud