mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 06:12:01 +01:00
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 MFC after: 3 days Sponsored by: Modirum MDPay Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D32775
This commit is contained in:
parent
9c0287e092
commit
c441592a0e
@ -364,7 +364,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;
|
||||
|
Loading…
Reference in New Issue
Block a user