Page MenuHomeFreeBSD

netgraph/ng_bridge: Make simple internal functions read-only
Needs ReviewPublic

Authored by lutz_donnerhacke.de on Wed, Jan 13, 8:22 PM.

Details

Reviewers
None
Group Reviewers
network
Summary

Switch very simple internal functions to explicit handle const data.

Depends on D28123

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 36182
Build 33071: arc lint + arc unit

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.