summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_main.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-02 22:06:01 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-10-10 09:05:02 -0300
commitf4e14fdba7de19ca660278a0b8c750140db5868b (patch)
tree58eb2d22e84b24672ddff1dd786f18e5bc555b15 /ospf6d/ospf6_main.c
parent5d56066e4645ce1104f766cb2a2b767b483c9ce5 (diff)
*: use rb-trees to store interfaces instead of sorted linked-lists
This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_main.c')
-rw-r--r--ospf6d/ospf6_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index e582737f94..2a6e56deb6 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -79,7 +79,7 @@ struct thread_master *master;
static void __attribute__((noreturn)) ospf6_exit(int status)
{
- struct listnode *node;
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
frr_early_fini();
@@ -89,7 +89,7 @@ static void __attribute__((noreturn)) ospf6_exit(int status)
bfd_gbl_exit();
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp))
+ RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
if (ifp->info != NULL)
ospf6_interface_delete(ifp->info);