summaryrefslogtreecommitdiff
path: root/zebra/zebra_ptm.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/zebra_ptm.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/zebra_ptm.c')
-rw-r--r--zebra/zebra_ptm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c
index 28e6c42ec6..4fc1173241 100644
--- a/zebra/zebra_ptm.c
+++ b/zebra/zebra_ptm.c
@@ -258,15 +258,15 @@ DEFUN (zebra_ptm_enable,
"ptm-enable",
"Enable neighbor check with specified topology\n")
{
+ struct vrf *vrf;
struct listnode *i;
struct interface *ifp;
struct zebra_if *if_data;
- vrf_iter_t iter;
ptm_cb.ptm_enable = ZEBRA_IF_PTM_ENABLE_ON;
- for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
- for (ALL_LIST_ELEMENTS_RO (vrf_iter2iflist (iter), i, ifp))
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ for (ALL_LIST_ELEMENTS_RO (vrf->iflist, i, ifp))
if (!ifp->ptm_enable)
{
if_data = (struct zebra_if *)ifp->info;
@@ -1112,13 +1112,13 @@ zebra_ptm_send_status_req(void)
void
zebra_ptm_reset_status(int ptm_disable)
{
+ struct vrf *vrf;
struct listnode *i;
struct interface *ifp;
int send_linkup;
- vrf_iter_t iter;
- for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
- for (ALL_LIST_ELEMENTS_RO (vrf_iter2iflist (iter), i, ifp))
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ for (ALL_LIST_ELEMENTS_RO (vrf->iflist, i, ifp))
{
send_linkup = 0;
if (ifp->ptm_enable)