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, Nov 18, 4:51 PM
Unknown Object (File)
Mon, Nov 4, 5:31 PM
Unknown Object (File)
Wed, Oct 23, 12:54 PM
Unknown Object (File)
Oct 2 2024, 12:12 PM
Unknown Object (File)
Oct 1 2024, 3:40 AM
Unknown Object (File)
Oct 1 2024, 3:40 AM
Unknown Object (File)
Oct 1 2024, 3:40 AM
Unknown Object (File)
Oct 1 2024, 3:40 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42487
Build 39375: arc lint + arc unit

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