Page MenuHomeFreeBSD

netlink: some refactoring of NETLINK_GENERIC layer
ClosedPublic

Authored by glebius on Jan 3 2025, 10:35 PM.
Tags
None
Referenced Files
F132447635: D48316.id148757.diff
Fri, Oct 17, 12:50 AM
Unknown Object (File)
Wed, Oct 8, 9:02 PM
Unknown Object (File)
Mon, Oct 6, 6:53 AM
Unknown Object (File)
Wed, Oct 1, 11:36 AM
Unknown Object (File)
Tue, Sep 30, 4:16 AM
Unknown Object (File)
Mon, Sep 29, 11:40 PM
Unknown Object (File)
Sep 13 2025, 8:10 PM
Unknown Object (File)
Sep 13 2025, 1:33 PM
Subscribers

Details

Summary
  • Statically initialize control family/group. This removes extra startup

code and provides a strong guarantee that they reside at the 0 index of
the respective arrays. Before a genl_register_family() with a higher
SYSINIT order could try to hijack index 0.

  • Remove the family_id field completely. Now the family ID as well as

group ID are array indices and there is basically no place for a mistake.
Previous code had a bug where a KPI user could induce an ID mismatch.

  • Merge netlink_generic_kpi.c to netlink_generic.c. Both files are small

and now there is more dependency between the control family and the family
allocator. Ok'ed by melifaro@.

Diff Detail

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