Page MenuHomeFreeBSD

netlink: some refactoring of NETLINK_GENERIC layer
ClosedPublic

Authored by glebius on Jan 3 2025, 10:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 6, 2:17 AM
Unknown Object (File)
Thu, Jun 4, 11:06 PM
Unknown Object (File)
Tue, Jun 2, 10:59 AM
Unknown Object (File)
Mon, May 25, 5:16 AM
Unknown Object (File)
Sun, May 24, 5:26 PM
Unknown Object (File)
Sun, May 24, 12:01 PM
Unknown Object (File)
Sun, May 24, 6:03 AM
Unknown Object (File)
Fri, May 22, 5:17 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