From nobody Thu Mar 24 17:10:34 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BF9BF1A31F35; Thu, 24 Mar 2022 17:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KPWvG4byYz3F1X; Thu, 24 Mar 2022 17:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648141834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tfo1u0H6wcmyZuqgB0SwAHG0xmCIw60m3WlsCymmLH8=; b=pZBMMZB2uvl3zJ3HXGlRGQkGy1ndt61m8cvTNAfX0zJT7ktU5OhBoa2J8BVhDGuSe8+YHa ReXG+oBOrWoBbQ5apTtxh4ncj9KV/uYmQkcXYLcrqd68TGBAaYiZsL04lAIUWoCp6fPpZ9 WNs4dATe5tVxTJ1G4e+L/8f32JVz7/FZ4REH/V/BczG+V53hy/MwoPeOgu22m9sw64jWg8 B8bHvdYwbxt/WO3D2avt2vEe9VDSjOERlHBXTzhfd6yohEWHxJBLEijwzmrnsYUJYegUEv sUKEEVwQRpKSNHjWeiUsKY+FhJUn84bkXc4uSVZxVuIb+jeE2in9vX1LMY/kIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CC2D1BF2F; Thu, 24 Mar 2022 17:10:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22OHAYPQ055461; Thu, 24 Mar 2022 17:10:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22OHAYtw055460; Thu, 24 Mar 2022 17:10:34 GMT (envelope-from git) Date: Thu, 24 Mar 2022 17:10:34 GMT Message-Id: <202203241710.22OHAYtw055460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4f69c575996e - stable/13 - Allow kern.ipc.maxsockets to be set to current value without error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f69c575996e069bfee62af9db2faa3ffa65db71 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648141834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tfo1u0H6wcmyZuqgB0SwAHG0xmCIw60m3WlsCymmLH8=; b=ad1FeUc6MLlFBeZ8fJLyR9lrVUfq11hcQg3oPBKuf162KHAZsXDYMzHELIj1bcP/uzevnM iZ4OtT5L69y57lAFBm9kLQvZsJedDQ1A2WbyQMjbDfOrv/nC9HsnGwfnK8K3mQ/Skp9f2u NtJ3hFh0ckiabhkxkbYm++x1IkC6+qNG4igNJJxZwI4wb2UnBGE26cHYg8qe/A+W4EvvfQ Owxi4Wj9STnbqnNoBUl+PDLXbq7UedY+XxZJSA3AxKQRsIT7QqX0eDs6YbED4f5nx5DTER o7r8uRPADPX0m7AzEP8iCbYUuYyPx4EkZ1pT5ThRyIRXbohG90y5qi3PotIApQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648141834; a=rsa-sha256; cv=none; b=vPDf50oNZC4oSugmcyK3oepvAsV5m4SeyUQJvaOpEFLOHg8UMttY4Mz+dGI2rTynumstwf YI0SNBmvzHG17kWzdrcZYbxIcnokSPXfKqCZ0EoBk6fKbRUM6S295u27wVmL4eZlSmGXmP 5DsVL7zug6gch3NHMRIuJZsnGVnIZNgkMUKqJNYpjN+DbVlUPqtNI4Ujz270P+bzA038mB 30o128+RIiRIrNbYMAu/ragNHyJKKLfzqanh3S8T2ojuyl34s8EEiN3pEM0nhYItcqmHzd 3vqMe3zUtB7e+KB4OkTOfgCnD5ZoMFTha0JomxEXHEJTfaM5dgQQKFc1aus2Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4f69c575996e069bfee62af9db2faa3ffa65db71 commit 4f69c575996e069bfee62af9db2faa3ffa65db71 Author: Allan Jude AuthorDate: 2021-11-04 12:55:33 +0000 Commit: Mark Johnston CommitDate: 2022-03-24 17:09:29 +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. PR: 243532 Reviewed by: markj Sponsored by: Modirum MDPay Sponsored by: Klara Inc. (cherry picked from commit c441592a0e1591591665cd037a8a5e9b54675f99) --- 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;