CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/11/04 02:51:52
Modified files:
sys/net : art.c art.h if.c if_enc.c if_etherip.c if_gif.c
if_gre.c if_mpe.c if_mpip.c if_mpw.c
if_spppsubr.c if_var.h if_vxlan.c pf_ioctl.c
route.c route.h rtable.c rtable.h
Log message:
Rework how rtables are allocated and reduce use of RT_TABLEID_MAX
Currently rtables use multiple arrays to do lookups and the reallocation
logic is complex and not race free. Replace all of this with a much
simpler lookup that is inspired by the if_idxmap used to map interfaces.
Use a single SMR backed object that contains the size and the array
of rtable pointers. This array can only grow and objects referenced
from the array are never freed. So the life-cycle becomes much simpler.
To make this work struct rtable needs to include all information
contained in a rtable / rdomain. This includes the sourceaddr per table,
the loopback interface index, the rtable to rdomain mapping and in the
future also the multicast router data. Once a struct rtable is allocated
it is never freed.
At the same time reduce the usage of RT_TABLEID_MAX and have rtable_exists
do the check against the real limit. In general code like SIOCSLIFPHYRTABLE
only need to verify that the rdomainid is non-negative and the upper limit
is enforced by the rtable code.
With lots of input, testing and OK gnezdo@