Open
Description
In zebra/rt_netlink.c
, we call vrf_lookup_by_id()
when we get a route to find the associated vrf object for that table.
This should be improved to be a hash table mapping of Table ID to zebra_vrf
object.
You would need to create a hash table probably in zebra/zebra_vrf.h
that uses the table_id
hash as a key and then update the code in vrf_lookup_by_id()
to use this.
This should be a fun one! Good luck!
To Reproduce
- Create a vrf in the kernel with iproute2
ip link add vrf-red type vrf table 1111
- Put an interface in the vrf
ip link add test type dummy
ip link set dev test master vrf-red
ip link set test up
- Create a route in the kernel with iproute2 in the vrf
ip route add 3.3.3.3/32 dev test vrf vrf-red
- Zebra reads in the route in the vrf and calls the function
With the new code you should be able to use that table ID 1111 to lookup the vrf.
Versions
- OS Kernel: [linux] [5.3]
- FRR Version [master]