summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-10-06 20:25:58 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-10-10 14:05:46 +0200
commit451fda4f9a2fadc24328e640077780a00ffcdac2 (patch)
treee5cb1b11502a6c525698d188ccc94adfea4515a1 /ospf6d
parentospf6d: Add missing vrf lookup (diff)
downloadfrr-451fda4f9a2fadc24328e640077780a00ffcdac2.tar.xz
frr-451fda4f9a2fadc24328e640077780a00ffcdac2.zip
*: 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 'ospf6d')
-rw-r--r--ospf6d/ospf6_bfd.c2
-rw-r--r--ospf6d/ospf6_interface.c8
-rw-r--r--ospf6d/ospf6_main.c2
-rw-r--r--ospf6d/ospf6_snmp.c6
4 files changed, 9 insertions, 9 deletions
diff --git a/ospf6d/ospf6_bfd.c b/ospf6d/ospf6_bfd.c
index 9f5d9fbd8..e28af9d06 100644
--- a/ospf6d/ospf6_bfd.c
+++ b/ospf6d/ospf6_bfd.c
@@ -155,7 +155,7 @@ static int ospf6_bfd_nbr_replay(int command, struct zclient *zclient,
bfd_client_sendmsg(zclient, ZEBRA_BFD_CLIENT_REGISTER);
/* Replay the neighbor, if BFD is enabled on the interface*/
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
oi = (struct ospf6_interface *)ifp->info;
if (!oi || !oi->bfd_info)
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index f8cefbf9e..f237e4bef 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -996,7 +996,7 @@ DEFUN (show_ipv6_ospf6_interface,
}
ospf6_interface_show(vty, ifp);
} else {
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
ospf6_interface_show(vty, ifp);
}
@@ -1059,7 +1059,7 @@ DEFUN (show_ipv6_ospf6_interface_prefix,
struct ospf6_interface *oi;
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
oi = (struct ospf6_interface *)ifp->info;
if (oi == NULL)
continue;
@@ -1759,7 +1759,7 @@ static int config_write_ospf6_interface(struct vty *vty)
struct ospf6_interface *oi;
struct interface *ifp;
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name) {
+ FOR_ALL_INTERFACES (vrf, ifp) {
oi = (struct ospf6_interface *)ifp->info;
if (oi == NULL)
continue;
@@ -1911,7 +1911,7 @@ DEFUN (clear_ipv6_ospf6_interface,
if (argc == 4) /* Clear all the ospfv3 interfaces. */
{
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
ospf6_interface_clear(vty, ifp);
} else /* Interface name is specified. */
{
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 2a6e56deb..4641f41c3 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -89,7 +89,7 @@ static void __attribute__((noreturn)) ospf6_exit(int status)
bfd_gbl_exit();
- RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, ifp)
if (ifp->info != NULL)
ospf6_interface_delete(ifp->info);
diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c
index dfe69aa0e..c14810744 100644
--- a/ospf6d/ospf6_snmp.c
+++ b/ospf6d/ospf6_snmp.c
@@ -956,7 +956,7 @@ static u_char *ospfv3WwLsdbEntry(struct variable *v, oid *name, size_t *length,
if (!ifslist)
return NULL;
ifslist->cmp = (int (*)(void *, void *))if_icmp_func;
- RB_FOREACH (iif, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, iif)
listnode_add_sort(ifslist, iif);
for (ALL_LIST_ELEMENTS_RO(ifslist, node, iif)) {
@@ -1093,7 +1093,7 @@ static u_char *ospfv3IfEntry(struct variable *v, oid *name, size_t *length,
if (!ifslist)
return NULL;
ifslist->cmp = (int (*)(void *, void *))if_icmp_func;
- RB_FOREACH (iif, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, iif)
listnode_add_sort(ifslist, iif);
for (ALL_LIST_ELEMENTS_RO(ifslist, i, iif)) {
@@ -1255,7 +1255,7 @@ static u_char *ospfv3NbrEntry(struct variable *v, oid *name, size_t *length,
if (!ifslist)
return NULL;
ifslist->cmp = (int (*)(void *, void *))if_icmp_func;
- RB_FOREACH (iif, if_name_head, &vrf->ifaces_by_name)
+ FOR_ALL_INTERFACES (vrf, iif)
listnode_add_sort(ifslist, iif);
for (ALL_LIST_ELEMENTS_RO(ifslist, i, iif)) {