summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--isisd/isis_circuit.c3
-rw-r--r--lib/if.c11
-rw-r--r--lib/if.h5
-rw-r--r--lib/vrf.c10
-rw-r--r--ospf6d/ospf6_bfd.c2
-rw-r--r--ospf6d/ospf6_interface.c8
-rw-r--r--ospf6d/ospf6_main.c2
-rw-r--r--ospfd/ospf_interface.c2
-rw-r--r--ospfd/ospf_te.c3
-rw-r--r--ospfd/ospf_vty.c8
-rw-r--r--ospfd/ospfd.c2
-rw-r--r--ripd/rip_interface.c14
-rw-r--r--ripd/ripd.c14
-rw-r--r--ripngd/ripng_interface.c10
-rw-r--r--ripngd/ripngd.c10
-rw-r--r--zebra/irdp_main.c36
-rw-r--r--zebra/zebra_ptm.c59
17 files changed, 101 insertions, 98 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index 83d0aa432..16ec409d4 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -32,6 +32,7 @@
#include "log.h"
#include "memory.h"
+#include "vrf.h"
#include "if.h"
#include "linklist.h"
#include "command.h"
@@ -1024,7 +1025,7 @@ isis_interface_config_write (struct vty *vty)
struct isis_circuit *circuit;
int i;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
if (ifp->ifindex == IFINDEX_DELETED)
continue;
diff --git a/lib/if.c b/lib/if.c
index 33481c32f..1d0518956 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -38,7 +38,6 @@
#include "log.h"
/* List of interfaces in only the default VRF */
-struct list *iflist;
int ptm_enable = 0;
/* One for each program. This structure is needed to store hooks. */
@@ -1261,7 +1260,7 @@ ifaddr_ipv4_lookup (struct in_addr *addr, unsigned int ifindex)
/* Initialize interface list. */
void
-if_init (vrf_id_t vrf_id, struct list **intf_list)
+if_init (struct list **intf_list)
{
*intf_list = list_new ();
#if 0
@@ -1269,13 +1268,10 @@ if_init (vrf_id_t vrf_id, struct list **intf_list)
#endif /* ifaddr_ipv4_table */
(*intf_list)->cmp = (int (*)(void *, void *))if_cmp_func;
-
- if (vrf_id == VRF_DEFAULT)
- iflist = *intf_list;
}
void
-if_terminate (vrf_id_t vrf_id, struct list **intf_list)
+if_terminate (struct list **intf_list)
{
for (;;)
{
@@ -1290,7 +1286,4 @@ if_terminate (vrf_id_t vrf_id, struct list **intf_list)
list_delete (*intf_list);
*intf_list = NULL;
-
- if (vrf_id == VRF_DEFAULT)
- iflist = NULL;
}
diff --git a/lib/if.h b/lib/if.h
index b65d95515..9c57cf769 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -324,8 +324,8 @@ extern int if_is_broadcast (struct interface *);
extern int if_is_pointopoint (struct interface *);
extern int if_is_multicast (struct interface *);
extern void if_add_hook (int, int (*)(struct interface *));
-extern void if_init (vrf_id_t, struct list **);
-extern void if_terminate (vrf_id_t, struct list **);
+extern void if_init (struct list **);
+extern void if_terminate (struct list **);
extern void if_dump_all (void);
extern const char *if_flag_dump(unsigned long);
@@ -364,7 +364,6 @@ extern char *if_indextoname (unsigned int, char *);
#endif
/* Exported variables. */
-extern struct list *iflist;
extern struct cmd_element interface_desc_cmd;
extern struct cmd_element no_interface_desc_cmd;
extern struct cmd_element interface_cmd;
diff --git a/lib/vrf.c b/lib/vrf.c
index 329e9a4d0..f730c539f 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -70,7 +70,7 @@ vrf_list_lookup_by_name (const char *name)
return NULL;
}
-/* Create new interface structure. */
+/* Create new vrf structure. */
struct vrf *
vrf_create (const char *name, size_t namelen)
{
@@ -184,7 +184,7 @@ vrf_get (vrf_id_t vrf_id, const char *name)
vrf->node = rn;
/* Initialize interfaces. */
- if_init (vrf_id, &vrf->iflist);
+ if_init (&vrf->iflist);
}
if (vrf_master.vrf_new_hook && name) {
@@ -210,7 +210,7 @@ vrf_delete (struct vrf *vrf)
(*vrf_master.vrf_delete_hook) (vrf->vrf_id, vrf->name, &vrf->info);
if (CHECK_FLAG (vrf->status, VRF_ACTIVE))
- if_terminate (vrf->vrf_id, &vrf->iflist);
+ if_terminate (&vrf->iflist);
if (vrf->node)
{
@@ -491,7 +491,7 @@ vrf_iflist_create (vrf_id_t vrf_id)
{
struct vrf * vrf = vrf_lookup (vrf_id);
if (vrf && !vrf->iflist)
- if_init (vrf_id, &vrf->iflist);
+ if_init (&vrf->iflist);
}
/* Free the interface list of the specified VRF. */
@@ -500,7 +500,7 @@ vrf_iflist_terminate (vrf_id_t vrf_id)
{
struct vrf * vrf = vrf_lookup (vrf_id);
if (vrf && vrf->iflist)
- if_terminate (vrf->vrf_id, &vrf->iflist);
+ if_terminate (&vrf->iflist);
}
/*
diff --git a/ospf6d/ospf6_bfd.c b/ospf6d/ospf6_bfd.c
index f14571d1f..adcfcbf19 100644
--- a/ospf6d/ospf6_bfd.c
+++ b/ospf6d/ospf6_bfd.c
@@ -161,7 +161,7 @@ ospf6_bfd_nbr_replay (int command, struct zclient *zclient, zebra_size_t length,
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
/* Replay the neighbor, if BFD is enabled on the interface*/
- for (ALL_LIST_ELEMENTS_RO (iflist, inode, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), inode, ifp))
{
oi = (struct ospf6_interface *) ifp->info;
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index d09f8b313..a111a2148 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -1009,7 +1009,7 @@ DEFUN (show_ipv6_ospf6_interface,
}
else
{
- for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), i, ifp))
ospf6_interface_show (vty, ifp);
}
@@ -1102,7 +1102,7 @@ DEFUN (show_ipv6_ospf6_interface_prefix,
struct ospf6_interface *oi;
struct interface *ifp;
- for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), i, ifp))
{
oi = (struct ospf6_interface *) ifp->info;
if (oi == NULL)
@@ -1816,7 +1816,7 @@ config_write_ospf6_interface (struct vty *vty)
struct ospf6_interface *oi;
struct interface *ifp;
- for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), i, ifp))
{
oi = (struct ospf6_interface *) ifp->info;
if (oi == NULL)
@@ -1984,7 +1984,7 @@ DEFUN (clear_ipv6_ospf6_interface,
if (argc == 0) /* Clear all the ospfv3 interfaces. */
{
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
ospf6_interface_clear (vty, ifp);
}
else /* Interface name is specified. */
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 4eb22c15a..9017e8b34 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -145,7 +145,7 @@ ospf6_exit (int status)
if (ospf6)
ospf6_delete (ospf6);
- for (ALL_LIST_ELEMENTS_RO(iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
if (ifp->info != NULL)
ospf6_interface_delete(ifp->info);
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index c0b4e7abe..628091963 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -1269,7 +1269,7 @@ void
ospf_if_init ()
{
/* Initialize Zebra interface data structure. */
- om->iflist = iflist;
+ om->iflist = vrf_iflist (VRF_DEFAULT);
if_add_hook (IF_NEW_HOOK, ospf_if_new_hook);
if_add_hook (IF_DELETE_HOOK, ospf_if_delete_hook);
}
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 6f19a2832..565a61aaa 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -33,6 +33,7 @@
#include "linklist.h"
#include "prefix.h"
+#include "vrf.h"
#include "if.h"
#include "table.h"
#include "memory.h"
@@ -1890,7 +1891,7 @@ DEFUN (show_mpls_te_link,
/* Show All Interfaces. */
if (argc == 0)
{
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
+ for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
show_mpls_te_link_sub (vty, ifp);
}
/* Interface name is specified. */
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 8cdf6e9d6..ab0ed14f1 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3927,7 +3927,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
if (argc == (iface_argv + 1))
{
/* Show All Interfaces.*/
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
if (ospf_oi_count(ifp))
{
@@ -3938,7 +3938,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
else if (argv[iface_argv] && strcmp(argv[iface_argv], "json") == 0)
{
/* Show All Interfaces. */
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
if (ospf_oi_count(ifp))
{
@@ -9280,7 +9280,7 @@ config_write_interface (struct vty *vty)
struct ospf_if_params *params;
struct ospf *ospf = ospf_lookup();
- for (ALL_LIST_ELEMENTS_RO (iflist, n1, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), n1, ifp))
{
if (memcmp (ifp->name, "VLINK", 5) == 0)
continue;
@@ -10284,7 +10284,7 @@ DEFUN (clear_ip_ospf_interface,
if (argc == 0) /* Clear all the ospfv2 interfaces. */
{
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
ospf_interface_clear(ifp);
}
else /* Interface name is specified. */
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 8fbecee05..d7d22a272 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -539,7 +539,7 @@ ospf_finish_final (struct ospf *ospf)
list_delete (ospf->vlinks);
/* Remove any ospf interface config params */
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
struct ospf_if_params *params;
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index c269ae07b..c9cccbbe1 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -357,7 +357,7 @@ if_check_address (struct in_addr addr)
struct listnode *node;
struct interface *ifp;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
struct listnode *cnode;
struct connected *connected;
@@ -504,7 +504,7 @@ rip_interface_clean (void)
struct interface *ifp;
struct rip_interface *ri;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
@@ -527,7 +527,7 @@ rip_interface_reset (void)
struct interface *ifp;
struct rip_interface *ri;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
@@ -634,7 +634,7 @@ rip_if_down_all ()
struct interface *ifp;
struct listnode *node, *nnode;
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
+ for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
rip_if_down (ifp);
}
@@ -1059,7 +1059,7 @@ rip_enable_apply_all ()
struct listnode *node, *nnode;
/* Check each interface. */
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
+ for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
rip_enable_apply (ifp);
}
@@ -1180,7 +1180,7 @@ rip_passive_interface_apply_all (void)
struct interface *ifp;
struct listnode *node, *nnode;
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
+ for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
rip_passive_interface_apply (ifp);
}
@@ -1924,7 +1924,7 @@ rip_interface_config_write (struct vty *vty)
struct listnode *node;
struct interface *ifp;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
struct rip_interface *ri;
diff --git a/ripd/ripd.c b/ripd/ripd.c
index acac8c1be..d16abcf72 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -22,6 +22,7 @@
#include <zebra.h>
+#include "vrf.h"
#include "if.h"
#include "command.h"
#include "prefix.h"
@@ -343,7 +344,8 @@ rip_nexthop_check (struct in_addr *addr)
/* If nexthop address matches local configured address then it is
invalid nexthop. */
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, ifc))
{
@@ -2477,7 +2479,7 @@ rip_update_process (int route_type)
struct prefix_ipv4 *p;
/* Send RIP update to each interface. */
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
if (if_is_loopback (ifp))
continue;
@@ -3535,7 +3537,7 @@ DEFUN (show_ip_rip_status,
vty_out (vty, " Interface Send Recv Key-chain%s", VTY_NEWLINE);
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
@@ -3567,7 +3569,7 @@ DEFUN (show_ip_rip_status,
{
int found_passive = 0;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
@@ -3766,7 +3768,7 @@ rip_distribute_update_all (struct prefix_list *notused)
struct interface *ifp;
struct listnode *node, *nnode;
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
+ for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
rip_distribute_update_interface (ifp);
}
/* ARGSUSED */
@@ -3957,7 +3959,7 @@ rip_routemap_update (const char *notused)
struct interface *ifp;
struct listnode *node, *nnode;
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
+ for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
rip_if_rmap_update_interface (ifp);
rip_routemap_update_redistribute ();
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index ca7f02ef5..15ce0a238 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -332,7 +332,7 @@ ripng_interface_clean (void)
struct interface *ifp;
struct ripng_interface *ri;
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
+ for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT), node, nnode, ifp))
{
ri = ifp->info;
@@ -355,7 +355,7 @@ ripng_interface_reset (void)
struct interface *ifp;
struct ripng_interface *ri;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
@@ -812,7 +812,7 @@ ripng_enable_apply_all (void)
struct interface *ifp;
struct listnode *node;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
ripng_enable_apply (ifp);
}
@@ -877,7 +877,7 @@ ripng_passive_interface_apply_all (void)
struct interface *ifp;
struct listnode *node;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
ripng_passive_interface_apply (ifp);
}
@@ -1148,7 +1148,7 @@ interface_config_write (struct vty *vty)
struct ripng_interface *ri;
int write = 0;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 85c866e06..8b71269c0 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -1449,7 +1449,7 @@ ripng_update (struct thread *t)
zlog_debug ("RIPng update timer expired!");
/* Supply routes to each interface. */
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
@@ -1532,7 +1532,7 @@ ripng_triggered_update (struct thread *t)
/* Split Horizon processing is done when generating triggered
updates as well as normal updates (see section 2.6). */
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
ri = ifp->info;
@@ -2143,7 +2143,7 @@ DEFUN (show_ipv6_ripng_status,
vty_out (vty, " Interface Send Recv%s", VTY_NEWLINE);
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
{
struct ripng_interface *ri;
@@ -2760,7 +2760,7 @@ ripng_distribute_update_all (struct prefix_list *notused)
struct interface *ifp;
struct listnode *node;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
ripng_distribute_update_interface (ifp);
}
@@ -2935,7 +2935,7 @@ ripng_routemap_update (const char *unused)
struct interface *ifp;
struct listnode *node;
- for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), node, ifp))
ripng_if_rmap_update_interface (ifp);
ripng_routemap_update_redistribute ();
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c
index c297979cf..af493c5c0 100644
--- a/zebra/irdp_main.c
+++ b/zebra/irdp_main.c
@@ -310,25 +310,27 @@ void irdp_finish()
struct interface *ifp;
struct zebra_if *zi;
struct irdp_interface *irdp;
+ vrf_iter_t iter;
zlog_info("IRDP: Received shutdown notification.");
-
- for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
- {
- zi = ifp->info;
-
- if (!zi)
- continue;
- irdp = &zi->irdp;
- if (!irdp)
- continue;
-
- if (irdp->flags & IF_ACTIVE )
- {
- irdp->flags |= IF_SHUTDOWN;
- irdp_advert_off(ifp);
- }
- }
+
+ for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
+ for (ALL_LIST_ELEMENTS (vrf_iter2iflist (iter), node, nnode, ifp))
+ {
+ zi = ifp->info;
+
+ if (!zi)
+ continue;
+ irdp = &zi->irdp;
+ if (!irdp)
+ continue;
+
+ if (irdp->flags & IF_ACTIVE )
+ {
+ irdp->flags |= IF_SHUTDOWN;
+ irdp_advert_off(ifp);
+ }
+ }
}
#endif /* HAVE_IRDP */
diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c
index bd4c03d1d..819f05162 100644
--- a/zebra/zebra_ptm.c
+++ b/zebra/zebra_ptm.c
@@ -246,16 +246,18 @@ DEFUN (zebra_ptm_enable,
{
struct listnode *i;
struct interface *ifp;
+ vrf_iter_t iter;
ptm_cb.ptm_enable = 1;
- for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp))
- if (!ifp->ptm_enable)
- {
- ifp->ptm_enable = 1;
- /* Assign a default unknown status */
- ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
- }
+ for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iter2iflist (iter), i, ifp))
+ if (!ifp->ptm_enable)
+ {
+ ifp->ptm_enable = 1;
+ /* Assign a default unknown status */
+ ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
+ }
zebra_ptm_connect(NULL);
@@ -984,25 +986,28 @@ zebra_ptm_reset_status(int ptm_disable)
struct listnode *i;
struct interface *ifp;
int send_linkup;
+ vrf_iter_t iter;
- for (ALL_LIST_ELEMENTS_RO (iflist, i, ifp))
- {
- send_linkup = 0;
- if (ifp->ptm_enable)
- {
- if (!if_is_operative(ifp))
- send_linkup = 1;
-
- if (ptm_disable)
- ifp->ptm_enable = 0;
- ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
-
- if (if_is_operative (ifp) && send_linkup) {
- if (IS_ZEBRA_DEBUG_EVENT)
- zlog_debug ("%s: Bringing up interface %s", __func__,
- ifp->name);
- if_up (ifp);
- }
- }
- }
+ for (iter = vrf_first (); iter != VRF_ITER_INVALID; iter = vrf_next (iter))
+ for (ALL_LIST_ELEMENTS_RO (vrf_iter2iflist (iter), i, ifp))
+ {
+ send_linkup = 0;
+ if (ifp->ptm_enable)
+ {
+ if (!if_is_operative(ifp))
+ send_linkup = 1;
+
+ if (ptm_disable)
+ ifp->ptm_enable = 0;
+ ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN;
+
+ if (if_is_operative (ifp) && send_linkup)
+ {
+ if (IS_ZEBRA_DEBUG_EVENT)
+ zlog_debug ("%s: Bringing up interface %s", __func__,
+ ifp->name);
+ if_up (ifp);
+ }
+ }
+ }
}