- struct ospf6_lsa *lsa;
- void (*showfunc) (struct vty *, struct ospf6_lsa *) = NULL;
-
- switch (level)
- {
- case OSPF6_LSDB_SHOW_LEVEL_DETAIL:
- showfunc = ospf6_lsa_show;
- break;
- case OSPF6_LSDB_SHOW_LEVEL_INTERNAL:
- showfunc = ospf6_lsa_show_internal;
- break;
- case OSPF6_LSDB_SHOW_LEVEL_DUMP:
- showfunc = ospf6_lsa_show_dump;
- break;
- case OSPF6_LSDB_SHOW_LEVEL_NORMAL:
- default:
- showfunc = ospf6_lsa_show_summary;
- }
-
- if (type && id && adv_router)
- {
- lsa = ospf6_lsdb_lookup (*type, *id, *adv_router, lsdb);
- if (lsa)
- {
- if (level == OSPF6_LSDB_SHOW_LEVEL_NORMAL)
- ospf6_lsa_show (vty, lsa);
- else
- (*showfunc) (vty, lsa);
- }
- return;
- }
-
- if (level == OSPF6_LSDB_SHOW_LEVEL_NORMAL)
- ospf6_lsa_show_summary_header (vty);
-
- if (type && adv_router)
- lsa = ospf6_lsdb_type_router_head (*type, *adv_router, lsdb);
- else if (type)
- lsa = ospf6_lsdb_type_head (*type, lsdb);
- else
- lsa = ospf6_lsdb_head (lsdb);
- while (lsa)
- {
- if ((! adv_router || lsa->header->adv_router == *adv_router) &&
- (! id || lsa->header->id == *id))
- (*showfunc) (vty, lsa);
-
- if (type && adv_router)
- lsa = ospf6_lsdb_type_router_next (*type, *adv_router, lsa);
- else if (type)
- lsa = ospf6_lsdb_type_next (*type, lsa);
- else
- lsa = ospf6_lsdb_next (lsa);
- }
-}
+ struct ospf6_lsa *lsa;
+ uint32_t id = 1, tmp_id;
+
+ /* This routine is curently invoked only for Inter-Prefix LSAs for
+ * non-summarized routes (no area/range).
+ */
+ for (ALL_LSDB_TYPED_ADVRTR(lsdb, type, adv_router, lsa)) {
+ tmp_id = ntohl(lsa->header->id);
+ if (tmp_id < id)
+ continue;
+
+ if (tmp_id > id) {
+ ospf6_lsdb_lsa_unlock(lsa);
+ break;
+ }
+ id++;
+ }