Page MenuHomeFreeBSD

sysctl: hide 2.x era compat node
ClosedPublic

Authored by kaktus on Dec 31 2019, 12:29 PM.

Details

Summary

r23081 introduced kern.dummy oid as a semi ABI compat for kern.maxsockbuf that was moved to a new namespace. It never functioned as an alias of any kind and was just returning 0 unconditionally, hence it was probably provided to keep some 3rd party programmes happy about sysctl(3) not reporting an error because of non-existing oid. After nearly 23 years it seems reasonable to just hide it from sysctl(8) list not to cause unnecessary confusion as for its purpose.

Reported by: Antranig Vartanian <antranigv@freebsd.am>

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kaktus created this revision.Dec 31 2019, 12:29 PM
kaktus updated this revision to Diff 66184.Dec 31 2019, 12:35 PM

update diff

kib added a comment.Dec 31 2019, 9:18 PM

I suspect that the point of providing the kern.dummy was to ensure that the old consumers of kern.maxockbuf get some value instead of error. Basically, it provides ABI compatibility for something that is 1. binary 2. very old.

Does it make some obstacle for real work ?

No problems, no. I understand that it was introduced as a combat for 3rd party binaries that hardcoded 1.31 as the oid, but the value 0 isn't helpful either.
How about CTLFLAG_SKIP so it wouldn't show up in sysctl(8) list?

kib added a comment.Jan 1 2020, 1:18 AM

How about CTLFLAG_SKIP so it wouldn't show up in sysctl(8) list?

This would only remove the mib from enumeration, right ? Then it is fine.

kaktus updated this revision to Diff 66209.Jan 1 2020, 2:37 PM
kaktus retitled this revision from sysctl: remove unused node to sysctl: hide 2.x era compat node.
kaktus edited the summary of this revision. (Show Details)
kaktus set the repository for this revision to rS FreeBSD src repository.

Update diff to use CTLFLAG_SKIP instead of completely removing KERN_DUMMY.

kib accepted this revision.Jan 1 2020, 11:29 PM

Perhaps add spaces around '|' as required by style.

This revision is now accepted and ready to land.Jan 1 2020, 11:29 PM
This revision was automatically updated to reflect the committed changes.