diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2017-10-02 22:06:01 -0300 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2017-10-10 09:05:02 -0300 | 
| commit | f4e14fdba7de19ca660278a0b8c750140db5868b (patch) | |
| tree | 58eb2d22e84b24672ddff1dd786f18e5bc555b15 /eigrpd/eigrp_vty.c | |
| parent | 5d56066e4645ce1104f766cb2a2b767b483c9ce5 (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 'eigrpd/eigrp_vty.c')
| -rw-r--r-- | eigrpd/eigrp_vty.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c index 59ec571684..5ca3a3bef2 100644 --- a/eigrpd/eigrp_vty.c +++ b/eigrpd/eigrp_vty.c @@ -132,11 +132,11 @@ static int config_write_interfaces(struct vty *vty, struct eigrp *eigrp)  static int eigrp_write_interface(struct vty *vty)  { -	struct listnode *node; +	struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);  	struct interface *ifp;  	struct eigrp_interface *ei; -	for (ALL_LIST_ELEMENTS_RO(vrf_iflist(VRF_DEFAULT), node, ifp)) { +	RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {  		ei = ifp->info;  		if (!ei)  			continue;  | 
