summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-10-29 14:37:11 -0200
committerRenato Westphal <renato@opensourcerouting.org>2016-11-28 16:18:35 -0200
commit1a1a70655c869a1b66e363894e5aba19f4aa08f3 (patch)
tree8eea443fc57ac5766128d41e27c9411a3c1c7afc /zebra/rt_netlink.c
parentc7fdd84f36a262d062a10c1439121df361ab78d3 (diff)
lib: convert vrf code to use red-black trees as well
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index f16fd55c98..b18bf1ef7a 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -98,12 +98,12 @@ Pending: create an efficient table_id (in a tree/hash) based lookup)
static vrf_id_t
vrf_lookup_by_table (u_int32_t table_id)
{
+ struct vrf *vrf;
struct zebra_vrf *zvrf;
- vrf_iter_t iter;
- for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
{
- if ((zvrf = vrf_iter2info (iter)) == NULL ||
+ if ((zvrf = vrf->info) == NULL ||
(zvrf->table_id != table_id))
continue;