summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@gmail.com>2017-06-16 10:44:31 -0300
committerRafael Zalamena <rzalamena@gmail.com>2017-06-16 10:44:31 -0300
commit45926e58749924a6ff207cf211de3e6457578ecc (patch)
tree36fc6b1e0f38826a3cc809e77e39d54c0588832a /zebra/zebra_rib.c
parentf43cd318b26a3dc57a0e6f40bcccdd5ce1886432 (diff)
lib: improve the RB implementation
Switch the RB tree implementation completely to the new dlg@'s version that uses pre-declared functions instead of macros for tree functions. Original e-mail/diff: https://marc.info/?l=openbsd-tech&m=147087487111068&w=2 Pros: * Reduces the amount of code that the usage of those macros generate * Allows the compiler to do a better compile-time check job * Might have better i-cache utilization since the tree code is shared Con: * dlg@ benchmarks shows it has 'very slightly slower' insertions * imported RB_* code must adapt the following calls: RB_INIT(), RB_GENERATE(), RB_ROOT(), RB_EMPTY(), make compare functions use 'const' (if not already) and maybe others.
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index e9ccac1c92..c2af0a0d22 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2897,7 +2897,7 @@ vrf_id_get_next (vrf_id_t vrf_id, vrf_id_t *next_id_p)
vrf = vrf_lookup_by_id (vrf_id);
if (vrf)
{
- vrf = RB_NEXT (vrf_id_head, &vrfs_by_id, vrf);
+ vrf = RB_NEXT (vrf_id_head, vrf);
if (vrf) {
*next_id_p = vrf->vrf_id;
return 1;