Page MenuHomeFreeBSD

socket: Move SO_SETFIB handling to protocol layers
AbandonedPublic

Authored by markj on Feb 4 2025, 5:11 PM.
Tags
None
Referenced Files
F168202503: D48833.id.diff
Wed, Aug 26, 9:03 PM
Unknown Object (File)
Thu, Jul 30, 5:46 PM
Unknown Object (File)
Thu, Jul 30, 5:19 AM
Unknown Object (File)
Thu, Jul 30, 3:28 AM
Unknown Object (File)
Tue, Jul 28, 2:29 PM
Unknown Object (File)
Tue, Jul 28, 7:35 AM
Unknown Object (File)
Jul 27 2026, 3:59 PM
Unknown Object (File)
Jul 23 2026, 3:26 AM

Details

Reviewers
None
Group Reviewers
network
Summary

In particular, we store a FIB number in both struct socket and in struct
inpcb. When updating the FIB number with setsockopt(SO_SETFIB), make
the update atomic. This is required to support the new bind_all_fibs
mode, since in that mode changing the FIB of a bound socket is not
permitted.

This requires a bit more code, but avoids a layering violation in
sosetopt(), where we hard-code the list of protocol families that
implement SO_SETFIB.

Sponsored by: Klara, Inc.
Sponsored by: Stormshield

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62242
Build 59126: arc lint + arc unit