From: Donald Sharp Date: Mon, 9 Mar 2020 13:47:46 +0000 (-0400) Subject: zebra: Expose vrf lookup by table id out of rt_netlink.c X-Git-Tag: base_7.4~48^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9d866c07c87a1452939feb7bd8bb91a3460cbccc;p=mirror%2Ffrr.git zebra: Expose vrf lookup by table id out of rt_netlink.c 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 --- diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 5c9d2f69a6..861d711631 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -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; diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h index d6a993e78a..a364d305c5 100644 --- a/zebra/rt_netlink.h +++ b/zebra/rt_netlink.h @@ -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 }