HomeFreeBSD

socket: Move SO_SETFIB handling to protocol layers

Description

socket: Move SO_SETFIB handling to protocol layers

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.

Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D48666

Details

Provenance
markjAuthored on Thu, Feb 6, 2:16 PM
Reviewer
glebius
Differential Revision
D48666: socket: Move SO_SETFIB handling to protocol layers
Parents
rG7034563f8ef3: tests: Add some FIB multibind test cases
Branches
Unknown
Tags
Unknown