]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Expose vrf lookup by table id out of rt_netlink.c
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 9 Mar 2020 13:47:46 +0000 (09:47 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 22 Apr 2020 14:56:06 +0000 (10:56 -0400)
The function rt_netlink.c is using to lookup the vrf by
passed in table id.

I'm also going to pretend that this function is not
so awful to run when we have a large number of routes
incoming.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rt_netlink.c
zebra/rt_netlink.h

index 5c9d2f69a68ebd26b5bc9c0fe7d6f0cb1a069ded..861d71163159008691b10f0ca9ab2769f4c3c319 100644 (file)
@@ -290,7 +290,7 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop)
 /*
 Pending: create an efficient table_id (in a tree/hash) based lookup)
  */
-static vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)
+vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)
 {
        struct vrf *vrf;
        struct zebra_vrf *zvrf;
index d6a993e78abef17557fc258ed1caa0b16c07c2ed..a364d305c5daec6d0b682b3e3a2ef9d743ac4819 100644 (file)
@@ -92,6 +92,7 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns,
                                            struct ethaddr *mac, uint16_t vid);
 extern int netlink_neigh_read_specific_ip(struct ipaddr *ip,
                                          struct interface *vlan_if);
+extern vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id);
 
 #ifdef __cplusplus
 }