Solved setfib on 9.3 - recompile kernel or built in?

I can't find any info on whether I need to rebuild my 9.3 kernel to include setfib(2) support or if I can just use it out of the box by adding it to my loader.conf.

Any info I find is either for 8.x which requires a custom kernel built or 10.x which works out of the box. Seems 9.3 is the OS that everyone forgot :/

anyone know? thanks!
 
Last edited by a moderator:
Look at the setfib(2) man page:
Code:
     The setfib() system call sets the associated fib for all sockets opened
     subsequent to the call, to be that of the argument fib.  The fib argument
     must be greater than or equal to 0 and less than the current system maxi-
     mum which may be retrieved by the net.fibs sysctl.  The system maximum is
     set in the kernel configuration file with

           options   ROUTETABLES=N

     or in /boot/loader.conf with

           net.fibs="N"

     where N is an integer.  However, this maximum is capped at 16 due to the
     implementation storing the fib number in a 4-bit field in mbuf(9) flags.
     The default fib of the process will be applied to all protocol families
     that support multiple fibs, and ignored by those that do not.  The
     default fib for a process may be overridden for a socket with the use of
     the SO_SETFIB socket option.

Taken from the man page of a FreeBSD 9.3 system. I think the "dynamic" net.fibs was added somewhere between 9.0 and 9.1.
 
Look at the setfib(2) man page:
Code:
     The setfib() system call sets the associated fib for all sockets opened
     subsequent to the call, to be that of the argument fib.  The fib argument
     must be greater than or equal to 0 and less than the current system maxi-
     mum which may be retrieved by the net.fibs sysctl.  The system maximum is
     set in the kernel configuration file with

           options   ROUTETABLES=N

     or in /boot/loader.conf with

           net.fibs="N"

     where N is an integer.  However, this maximum is capped at 16 due to the
     implementation storing the fib number in a 4-bit field in mbuf(9) flags.
     The default fib of the process will be applied to all protocol families
     that support multiple fibs, and ignored by those that do not.  The
     default fib for a process may be overridden for a socket with the use of
     the SO_SETFIB socket option.

Taken from the man page of a FreeBSD 9.3 system. I think the "dynamic" net.fibs was added somewhere between 9.0 and 9.1.


Yeah I was reading that but the bottom of the page said 10.2 so I didn't know for certain. The man page in my 9.3 build didn't have that info nor did the release notes ... Thank you for the speedy response!
 
The forum's man page linker always seems to link to the latest release, but the text I quoted came from one of my 9.3-RELEASE systems. Oddly enough the online man page for 9.3-RELEASE does indeed show 10.2 at the bottom. Must have something to do with the way they're generated. My local version shows the correct version:
Code:
HISTORY
     The setfib() function appeared in FreeBSD 7.1.

FreeBSD 9.3                     March 19, 2012                     FreeBSD 9.3

Note that it's a section 2 (System calls) man page, not the section 1 (user commands) that comes up by default.
 
Back
Top