]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: Fix coverity errors 8273/head
authorlynne <lynne@voltanet.io>
Tue, 16 Mar 2021 20:08:59 +0000 (16:08 -0400)
committerlynne <lynne@voltanet.io>
Tue, 16 Mar 2021 20:08:59 +0000 (16:08 -0400)
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
ospf6d/ospf6_asbr.c

index beca6b9690838984b551a43ba10e3f2671efc6cc..977d810be50ed6d21525d79d80cfd5d9dcb7aaec 100644 (file)
@@ -1106,7 +1106,7 @@ void ospf6_asbr_remove_externals_from_area(struct ospf6_area *oa)
        struct listnode *node, *nnode;
        struct ospf6_area *area;
        struct ospf6 *ospf6 = oa->ospf6;
-
+       const struct route_node *iterend;
 
        /* skip if router is in other non-stub areas */
        for (ALL_LIST_ELEMENTS(ospf6->area_list, node, nnode, area))
@@ -1114,9 +1114,12 @@ void ospf6_asbr_remove_externals_from_area(struct ospf6_area *oa)
                        return;
 
        /* if router is only in a stub area then purge AS-External LSAs */
-       for (ALL_LSDB(oa->ospf6->lsdb, lsa, lsanext)) {
+       iterend = ospf6_lsdb_head(ospf6->lsdb, 0, 0, 0, &lsa);
+       while (lsa != NULL) {
+               lsanext = ospf6_lsdb_next(iterend, lsa);
                if (ntohs(lsa->header->type) == OSPF6_LSTYPE_AS_EXTERNAL)
                        ospf6_lsdb_remove(lsa, ospf6->lsdb);
+               lsa = lsanext;
        }
 }