Skip to content

Add Mapping From Table ID to VRF #5982

Open
@sworleys

Description

@sworleys

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

  1. Create a vrf in the kernel with iproute2
  2. ip link add vrf-red type vrf table 1111
  3. Put an interface in the vrf
  4. ip link add test type dummy
  5. ip link set dev test master vrf-red
  6. ip link set test up
  7. Create a route in the kernel with iproute2 in the vrf
  8. ip route add 3.3.3.3/32 dev test vrf vrf-red
  9. 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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions