HomeFreeBSD

routing: Initialize V_rt_numfibs earlier during boot

Description

routing: Initialize V_rt_numfibs earlier during boot

V_rt_numfibs can be set at compile time (with the ROUTETABLES kernel
config option) or boot time (with the net.fibs tunable).
vnet_rtables_init(), running during SI_PROTO_DOMAIN, was checking the
tunable and updating V_rt_numfibs accordingly, but that means that
earlier SYSINITs, such as vnet_mroute_init(), see the compile-time value
for V_rt_numfibs before it gets corrected in vnet_rtables_init().

Fix this by initializing V_rt_numfibs earlier, so that SYSINITs are less
likely to use the wrong value.

Add a comment describing the weird, preexisting semantic of resetting
rt_numfibs to 1 in VNET jails.

PR: 294510
Reviewed by: glebius, zlei, pouria
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56473

(cherry picked from commit 2b264cb802b9b45306b1f3dfd3e9d4edfb23b2f6)

Details

Provenance
markjAuthored on Apr 18 2026, 12:20 PM
Reviewer
glebius
Differential Revision
D56473: route: Initialize V_rt_numfibs earlier during boot
Parents
rG61c9f9b482ca: tcp: cleanup
Branches
Unknown
Tags
Unknown