Changeset View
Changeset View
Standalone View
Standalone View
lib/libsys/setfib.2
Show All 16 Lines | |||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.Dd March 19, 2012 | .Dd January 10, 2025 | ||||
.Dt SETFIB 2 | .Dt SETFIB 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm setfib | .Nm setfib | ||||
.Nd set the default FIB (routing table) for the calling process | .Nd set the default FIB (routing table) for the calling process | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
Show All 16 Lines | |||||
sysctl. | sysctl. | ||||
The system maximum is set in the kernel configuration file with | The system maximum is set in the kernel configuration file with | ||||
.Bd -ragged -offset indent | .Bd -ragged -offset indent | ||||
.Cd "options ROUTETABLES=" Ns Em N | .Cd "options ROUTETABLES=" Ns Em N | ||||
.Ed | .Ed | ||||
.Pp | .Pp | ||||
or in | or in | ||||
.Pa /boot/loader.conf | .Pa /boot/loader.conf | ||||
or | |||||
.Pa /etc/sysctl.conf | |||||
with | with | ||||
.Pp | .Pp | ||||
.Dl net.fibs= Ns Qq Em N | .Dl net.fibs= Ns Qq Em N | ||||
.Pp | .Pp | ||||
where | where | ||||
.Em N | .Em N | ||||
is an integer. | is an integer smaller than 65536. | ||||
This maximum is capped at 65536 due to the implementation storing | Note that the number of FIBs may be increased after booting, but cannot be | ||||
the fib number in a 16-bit field in the | reduced. | ||||
.Pp | |||||
The maximum of 65536 is due to the implementation storing | |||||
the FIB number in a 16-bit field in the | |||||
.Xr mbuf 9 | .Xr mbuf 9 | ||||
packet header, however it is not suggested that one use such a large number | packet header, however it is not suggested that one use such a large number | ||||
as memory is allocated for every FIB regardless of whether it is used, and | as memory is allocated for every FIB regardless of whether it is used, and | ||||
there are places where all FIBs are iterated over. | there are places where all FIBs are iterated over. | ||||
.Pp | .Pp | ||||
The default FIB of the process will be applied to all protocol families | The default FIB of the process will be applied to all protocol families | ||||
that support multiple FIBs, and ignored by those that do not. | 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 | The default FIB for a process may be overridden for a socket with the use | ||||
Show All 31 Lines |