Page MenuHomeFreeBSD

Allow kern.ipc.maxsockets to be set to current value without error
ClosedPublic

Authored by allanjude on Nov 1 2021, 1:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 1, 1:14 PM
Unknown Object (File)
Mar 22 2024, 12:15 PM
Unknown Object (File)
Mar 7 2024, 3:25 PM
Unknown Object (File)
Mar 2 2024, 1:21 PM
Unknown Object (File)
Dec 28 2023, 10:17 PM
Unknown Object (File)
Dec 23 2023, 1:28 AM
Unknown Object (File)
Dec 12 2023, 1:41 PM
Unknown Object (File)
Dec 2 2023, 8:32 AM
Subscribers

Details

Summary

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
Sponsored by: Modirum MDPay
Sponsored by: Klara Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

LGTM, just some nitpicking.

sys/kern/uipc_socket.c
368

I would omit the comment, or explain why it's useful to permit this case. The "what" is already obvious, the "why" a little less so.

370

This can just be return (0);. Or move the test into the top-level check: if (error == 0 && req->newptr != NULL && newmaxsockets != maxsockets).

This revision is now accepted and ready to land.Nov 1 2021, 1:49 PM

Address review feedback from markj

This revision now requires review to proceed.Nov 4 2021, 12:39 AM
This revision is now accepted and ready to land.Nov 4 2021, 12:44 PM