Page MenuHomeFreeBSD

netgraph/ng_bridge: Make simple internal functions read-only

Authored by donner on Jan 13 2021, 8:22 PM.
Referenced Files
Unknown Object (File)
Wed, Jul 10, 9:15 AM
Unknown Object (File)
Mon, Jul 8, 2:11 PM
Unknown Object (File)
Sat, Jun 29, 3:45 PM
Unknown Object (File)
Thu, Jun 27, 10:03 PM
Unknown Object (File)
Tue, Jun 25, 12:15 PM
Unknown Object (File)
Tue, Jun 25, 11:11 AM
Unknown Object (File)
Jun 3 2024, 5:27 PM
Unknown Object (File)
Jun 3 2024, 5:27 PM

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

revert the idea of specialized "const pointers"

It's far that simple. I missed the difference between

  • const node_p: a constant pointer to a modifiable node.
  • struct ng_node const * : a modifiable pointer to a constant node.

Because I need immutable data structures, the latter is required.
But those structures and helper functions are defined in the central netgraph.h and ng_base.c.
Hence I have to annotate the base system with const, and also every helper function, which does not modify the data.

I think it's worth the effort, because it will ease the way write multithreaded netgraph modules and fix several still hidden race conditions.

  • Fix some formatting, line up comments.
  • Annotate helper functions to handle immutable objects.
kp added a subscriber: kp.


This revision is now accepted and ready to land.Feb 7 2021, 8:40 AM