Page MenuHomeFreeBSD

routing: populate fibs with interface routes after growing net.fibs.
ClosedPublic

Authored by melifaro on Aug 8 2022, 2:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 30, 10:49 AM
Unknown Object (File)
Sun, Oct 20, 2:52 PM
Unknown Object (File)
Thu, Oct 17, 7:31 PM
Unknown Object (File)
Oct 9 2024, 10:23 AM
Unknown Object (File)
Oct 1 2024, 7:52 AM
Unknown Object (File)
Sep 29 2024, 5:24 PM
Unknown Object (File)
Sep 29 2024, 1:15 PM
Unknown Object (File)
Sep 29 2024, 7:08 AM
Subscribers

Details

Summary

Currently it is possible to extend number of fibs in runtime, but this
functionality is of limited use when net.add_addrs_all_fibs is
non-zero, as the routing tables are created empty.

This change automatically populate newly-created fibs with the kernel-originated
interface routes (filtered by RTF_PINNED flag) if net.add_addrs_all_fibs
is set.

MFC after: 1 month

Test Plan
# OLD behavior
14:51 [0] m@devel0 s sysctl net.fibs=3
net.fibs: 2 -> 3
14:51 [0] m@devel0 setfib 2 netstat -rn
Routing tables (fib: 2)
14:51 [0] m@devel0
# NEW behaviour
14:51 [0] m@devel0 s sysctl net.add_addr_allfibs=1
net.add_addr_allfibs: 0 -> 1
14:51 [0] m@devel0 s sysctl net.fibs=4
net.fibs: 3 -> 4
14:51 [0] m@devel0 setfib 3 netstat -rn
Routing tables (fib: 3)

Internet:
Destination        Gateway            Flags     Netif Expire
10.0.0.0/24        link#1             U        vtnet0
10.0.0.157         link#1             UHS         lo0
127.0.0.1          link#2             UH          lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::1                               link#2                        UHS         lo0
2a01:4f8:13a:70c:ffff::/96        link#1                        U        vtnet0
2a01:4f8:13a:70c:ffff::6          link#1                        UHS         lo0
fe80::%vtnet0/64                  link#1                        U        vtnet0
fe80::5054:ff:fe42:fef%vtnet0     link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Update rib_copy_route() signature.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 11 2022, 12:51 PM
This revision was automatically updated to reflect the committed changes.