summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-06 15:25:58 -0300
committerRenato Westphal <renato@opensourcerouting.org>2017-10-10 09:05:46 -0300
commit451fda4f9a2fadc24328e640077780a00ffcdac2 (patch)
treee5cb1b11502a6c525698d188ccc94adfea4515a1 /zebra/interface.c
parenta6ba931e0bd4adddbde35dae585d2ffa5e9c78db (diff)
*: use the FOR_ALL_INTERFACES abstraction from babeld
This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index fe72419642..e912b2dcf8 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1328,7 +1328,7 @@ DEFUN (show_interface,
/* All interface print. */
vrf = vrf_lookup_by_id(vrf_id);
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
if_dump_vty(vty, ifp);
return CMD_SUCCESS;
@@ -1350,7 +1350,7 @@ DEFUN (show_interface_vrf_all,
/* All interface print. */
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
if_dump_vty(vty, ifp);
return CMD_SUCCESS;
@@ -1429,7 +1429,7 @@ static void if_show_description(struct vty *vty, vrf_id_t vrf_id)
struct interface *ifp;
vty_out(vty, "Interface Status Protocol Description\n");
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
int len;
len = vty_out(vty, "%s", ifp->name);
@@ -2835,7 +2835,7 @@ static int if_config_write(struct vty *vty)
zebra_ptm_write(vty);
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
struct zebra_if *if_data;
struct listnode *addrnode;
struct connected *ifc;