Page MenuHomeFreeBSD

iflib: Make if_shared_ctx_t a pointer to const
ClosedPublic

Authored by markj on Mar 5 2021, 9:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 23, 10:53 AM
Unknown Object (File)
Wed, Feb 11, 6:48 PM
Unknown Object (File)
Wed, Feb 11, 3:48 PM
Unknown Object (File)
Sun, Feb 8, 10:03 AM
Unknown Object (File)
Sat, Feb 7, 5:25 PM
Unknown Object (File)
Sat, Jan 31, 6:47 AM
Unknown Object (File)
Jan 25 2026, 10:23 AM
Unknown Object (File)
Jan 22 2026, 1:50 PM
Subscribers

Details

Summary

This structure is shared among multiple instances of a driver, so we
should ensure that it doesn't somehow get treated as if there's a
separate instance per interface. This is especially important for
software-only drivers like wg.

We could perhaps make DEVICE_REGISTER return a pointer to const as well,
so the sctx structures themselves could be defined as const. I don't
quite understand what this method is supposed to do in the general case
though, so I didn't modify it.

Diff Detail

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

Event Timeline

markj requested review of this revision.Mar 5 2021, 9:10 PM
sys/net/iflib.h
52

This is the meat of the change, the rest is required to compile after.

This revision is now accepted and ready to land.Mar 5 2021, 10:15 PM
This revision was automatically updated to reflect the committed changes.