diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-07-14 12:18:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-14 12:18:06 -0400 |
| commit | 9b42781b5de1c5053233666ac7d5d9e553a9f81e (patch) | |
| tree | 6a1efa3d20dc29f4a51802a9c6aa6ca144e1e6da /ospf6d/ospf6_intra.c | |
| parent | 9eb03e75656a96a4ca78620633c649e00b0f883d (diff) | |
| parent | 53a37141f990c8a81e186559ebbeaaad5ddd4a04 (diff) | |
Merge pull request #794 from opensourcerouting/table-hash-ospf6-lsdb-refactor
use hash in lib/table, also refactor ospf6 lsdb code
Diffstat (limited to 'ospf6d/ospf6_intra.c')
| -rw-r--r-- | ospf6d/ospf6_intra.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index 41271d8028..0ab503d152 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)); @@ -1095,8 +1093,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; @@ -1428,8 +1425,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; |
