summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_network.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-03 03:06:01 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-10-10 14:05:02 +0200
commitf4e14fdba7de19ca660278a0b8c750140db5868b (patch)
tree58eb2d22e84b24672ddff1dd786f18e5bc555b15 /eigrpd/eigrp_network.c
parentlib: register 'if_var_handlers' only once (diff)
downloadfrr-f4e14fdba7de19ca660278a0b8c750140db5868b.tar.xz
frr-f4e14fdba7de19ca660278a0b8c750140db5868b.zip
*: 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 'eigrpd/eigrp_network.c')
-rw-r--r--eigrpd/eigrp_network.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eigrpd/eigrp_network.c b/eigrpd/eigrp_network.c
index 50e6b7b3b..56b63597e 100644
--- a/eigrpd/eigrp_network.c
+++ b/eigrpd/eigrp_network.c
@@ -231,9 +231,9 @@ int eigrp_if_drop_allspfrouters(struct eigrp *top, struct prefix *p,
int eigrp_network_set(struct eigrp *eigrp, struct prefix *p)
{
+ struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct route_node *rn;
struct interface *ifp;
- struct listnode *node;
rn = route_node_get(eigrp->networks, (struct prefix *)p);
if (rn->info) {
@@ -251,7 +251,7 @@ int eigrp_network_set(struct eigrp *eigrp, struct prefix *p)
eigrp_router_id_update(eigrp);
/* Run network config now. */
/* Get target interface. */
- for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) {
+ RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
zlog_debug("Setting up %s", ifp->name);
eigrp_network_run_interface(eigrp, p, ifp);
}