summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_intra.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-07-07 17:23:30 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-07-11 13:48:20 +0200
commit49dd8e3758979254e74b8bf3480ea8a607f084b8 (patch)
tree5fe7dc765b9d054e4b965d1c2ae120aa02a27e70 /ospf6d/ospf6_intra.c
parent736ac221d1e89f3f35703d5175057404de62b50b (diff)
ospf6d: use macro for LSDB walks
... to make it easier to refactor all of the iteration uses. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_intra.c')
-rw-r--r--ospf6d/ospf6_intra.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 6acd45b7c1..4238fd224e 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -341,8 +341,7 @@ ospf6_router_lsa_originate (struct thread *thread)
type = ntohs (OSPF6_LSTYPE_ROUTER);
router = oa->ospf6->router_id;
count = 0;
- for (lsa = ospf6_lsdb_type_router_head (type, router, oa->lsdb); lsa;
- lsa = ospf6_lsdb_type_router_next (type, router, lsa))
+ for (ALL_LSDB_TYPED_ADVRTR(oa->lsdb, type, router, lsa))
{
if (ntohl (lsa->header->id) < link_state_id)
continue;
@@ -495,8 +494,7 @@ ospf6_network_lsa_originate (struct thread *thread)
/* Collect the interface's Link-LSAs to describe
network's optional capabilities */
type = htons (OSPF6_LSTYPE_LINK);
- for (lsa = ospf6_lsdb_type_head (type, oi->lsdb); lsa;
- lsa = ospf6_lsdb_type_next (type, lsa))
+ for (ALL_LSDB_TYPED(oi->lsdb, type, lsa))
{
link_lsa = (struct ospf6_link_lsa *)
((caddr_t) lsa->header + sizeof (struct ospf6_lsa_header));
@@ -1096,8 +1094,7 @@ ospf6_intra_prefix_lsa_originate_transit (struct thread *thread)
route_advertise = ospf6_route_table_create (0, 0);
type = ntohs (OSPF6_LSTYPE_LINK);
- for (lsa = ospf6_lsdb_type_head (type, oi->lsdb); lsa;
- lsa = ospf6_lsdb_type_next (type, lsa))
+ for (ALL_LSDB_TYPED(oi->lsdb, type, lsa))
{
if (OSPF6_LSA_IS_MAXAGE (lsa))
continue;
@@ -1429,8 +1426,7 @@ ospf6_intra_route_calculation (struct ospf6_area *oa)
route->flag = OSPF6_ROUTE_REMOVE;
type = htons (OSPF6_LSTYPE_INTRA_PREFIX);
- for (lsa = ospf6_lsdb_type_head (type, oa->lsdb); lsa;
- lsa = ospf6_lsdb_type_next (type, lsa))
+ for (ALL_LSDB_TYPED(oa->lsdb, type, lsa))
ospf6_intra_prefix_lsa_add (lsa);
oa->route_table->hook_add = hook_add;