Page MenuHomeFreeBSD

socket: Add an option to retrieve a socket's FIB number
ClosedPublic

Authored by markj on Feb 4 2025, 5:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 28, 4:02 AM
Unknown Object (File)
Wed, Apr 23, 6:28 AM
Unknown Object (File)
Wed, Apr 23, 6:05 AM
Unknown Object (File)
Tue, Apr 22, 8:04 AM
Unknown Object (File)
Tue, Apr 22, 3:18 AM
Unknown Object (File)
Mon, Apr 21, 6:40 AM
Unknown Object (File)
Sun, Apr 20, 11:27 PM
Unknown Object (File)
Mar 27 2025, 3:36 AM

Details

Summary

The SO_SETFIB option can be used to set a socket's FIB number, but there
is no way to retrieve it. Rename SO_SETFIB to SO_FIB and implement a
handler for it for getsockopt(2).

Sponsored by: Klara, Inc.
Sponsored by: Stormshield

Diff Detail

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

Event Timeline

markj requested review of this revision.Feb 4 2025, 5:11 PM

If we move the fib to pcb would we be able to preserve this API? Of course it would start fail on sockets where FIB doesn't make any sense. But would we be able to preserve for meaningful sockets?

This revision is now accepted and ready to land.Feb 4 2025, 7:04 PM

If we move the fib to pcb would we be able to preserve this API? Of course it would start fail on sockets where FIB doesn't make any sense. But would we be able to preserve for meaningful sockets?

Yes, the handler could be moved to the protocol layer, like I did for setsockopt(SO_SETFIB) in D48666.