Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2022 17:24:22 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 26714a5fa2c6 - releng/13.1 - Allow kern.ipc.maxsockets to be set to current value without error
Message-ID:  <202203241724.22OHOMBG072982@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.1 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=26714a5fa2c650f530b4977f1a005bad5f875567

commit 26714a5fa2c650f530b4977f1a005bad5f875567
Author:     Allan Jude <allanjude@FreeBSD.org>
AuthorDate: 2021-11-04 12:55:33 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-03-24 17:24:07 +0000

    Allow kern.ipc.maxsockets to be set to current value without error
    
    Normally setting kern.ipc.maxsockets returns EINVAL if the new value
    is not greater than the previous value. This can cause spurious
    error messages when sysctl.conf is processed multiple times, or when
    automation systems try to ensure the sysctl is set to the correct
    value. If the value is unchanged, then just do nothing.
    
    Approved by:    re (gjb)
    PR:     243532
    Reviewed by:    markj
    Sponsored by:   Modirum MDPay
    Sponsored by:   Klara Inc.
    
    (cherry picked from commit c441592a0e1591591665cd037a8a5e9b54675f99)
    (cherry picked from commit 4f69c575996e069bfee62af9db2faa3ffa65db71)
---
 sys/kern/uipc_socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 5a3748eb8cf5..bdd7756916d9 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -363,7 +363,7 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS)
 
 	newmaxsockets = maxsockets;
 	error = sysctl_handle_int(oidp, &newmaxsockets, 0, req);
-	if (error == 0 && req->newptr) {
+	if (error == 0 && req->newptr && newmaxsockets != maxsockets) {
 		if (newmaxsockets > maxsockets &&
 		    newmaxsockets <= maxfiles) {
 			maxsockets = newmaxsockets;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203241724.22OHOMBG072982>