From 93840fdef625ed5e77c24abcf9481709a045b56c Mon Sep 17 00:00:00 2001 From: Sean Eric Fagan Date: Wed, 14 Nov 2018 19:06:43 +0000 Subject: [PATCH] mountd has no way to configure the listen queue depth; rather than add a new option, we pass -1 down to listen, which causes it to use the kern.ipc.soacceptqueue sysctl. Approved by: mav MFC after: 2 weeks Sponsored by: iXsystems Inc --- usr.sbin/mountd/mountd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 6a7ec43ec5ad..1a10e9dc1c60 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -908,8 +908,12 @@ complete_service(struct netconfig *nconf, char *port_str) if (fd < 0) continue; + /* + * Using -1 tells listen(2) to use + * kern.ipc.soacceptqueue for the backlog. + */ if (nconf->nc_semantics != NC_TPI_CLTS) - listen(fd, SOMAXCONN); + listen(fd, -1); if (nconf->nc_semantics == NC_TPI_CLTS ) transp = svc_dg_create(fd, 0, 0);