]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_neighbor.c
Merge pull request #5081 from pguibert6WIND/show_brief_doc
[mirror_frr.git] / ospf6d / ospf6_neighbor.c
index 46dc621ae7d169bcd02b3897b1a47fa002c4f8ee..4318db52252d2033a94ecfe164be2c86361707c9 100644 (file)
@@ -112,11 +112,15 @@ struct ospf6_neighbor *ospf6_neighbor_create(uint32_t router_id,
 
 void ospf6_neighbor_delete(struct ospf6_neighbor *on)
 {
-       struct ospf6_lsa *lsa;
+       struct ospf6_lsa *lsa, *lsa_next;
+       const struct route_node *iterend;
 
        ospf6_lsdb_remove_all(on->summary_list);
        ospf6_lsdb_remove_all(on->request_list);
-       for (ALL_LSDB(on->retrans_list, lsa)) {
+
+       for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+            lsa = lsa_next) {
+               lsa_next = ospf6_lsdb_next(iterend, lsa);
                ospf6_decrement_retrans_count(lsa);
                ospf6_lsdb_remove(lsa, on->retrans_list);
        }
@@ -287,7 +291,8 @@ int twoway_received(struct thread *thread)
 int negotiation_done(struct thread *thread)
 {
        struct ospf6_neighbor *on;
-       struct ospf6_lsa *lsa;
+       struct ospf6_lsa *lsa, *lsa_next;
+       const struct route_node *iterend;
 
        on = (struct ospf6_neighbor *)THREAD_ARG(thread);
        assert(on);
@@ -301,7 +306,10 @@ int negotiation_done(struct thread *thread)
        /* clear ls-list */
        ospf6_lsdb_remove_all(on->summary_list);
        ospf6_lsdb_remove_all(on->request_list);
-       for (ALL_LSDB(on->retrans_list, lsa)) {
+
+       for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+            lsa = lsa_next) {
+               lsa_next = ospf6_lsdb_next(iterend, lsa);
                ospf6_decrement_retrans_count(lsa);
                ospf6_lsdb_remove(lsa, on->retrans_list);
        }
@@ -495,7 +503,8 @@ int seqnumber_mismatch(struct thread *thread)
 int bad_lsreq(struct thread *thread)
 {
        struct ospf6_neighbor *on;
-       struct ospf6_lsa *lsa;
+       struct ospf6_lsa *lsa, *lsa_next;
+       const struct route_node *iterend;
 
        on = (struct ospf6_neighbor *)THREAD_ARG(thread);
        assert(on);
@@ -514,7 +523,10 @@ int bad_lsreq(struct thread *thread)
 
        ospf6_lsdb_remove_all(on->summary_list);
        ospf6_lsdb_remove_all(on->request_list);
-       for (ALL_LSDB(on->retrans_list, lsa)) {
+
+       for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+            lsa = lsa_next) {
+               lsa_next = ospf6_lsdb_next(iterend, lsa);
                ospf6_decrement_retrans_count(lsa);
                ospf6_lsdb_remove(lsa, on->retrans_list);
        }
@@ -532,7 +544,8 @@ int bad_lsreq(struct thread *thread)
 int oneway_received(struct thread *thread)
 {
        struct ospf6_neighbor *on;
-       struct ospf6_lsa *lsa;
+       struct ospf6_lsa *lsa, *lsa_next;
+       const struct route_node *iterend;
 
        on = (struct ospf6_neighbor *)THREAD_ARG(thread);
        assert(on);
@@ -549,7 +562,9 @@ int oneway_received(struct thread *thread)
 
        ospf6_lsdb_remove_all(on->summary_list);
        ospf6_lsdb_remove_all(on->request_list);
-       for (ALL_LSDB(on->retrans_list, lsa)) {
+       for (iterend = ospf6_lsdb_head(on->retrans_list, 0, 0, 0, &lsa); lsa;
+            lsa = lsa_next) {
+               lsa_next = ospf6_lsdb_next(iterend, lsa);
                ospf6_decrement_retrans_count(lsa);
                ospf6_lsdb_remove(lsa, on->retrans_list);
        }
@@ -618,7 +633,7 @@ static void ospf6_neighbor_show(struct vty *vty, struct ospf6_neighbor *on)
        snprintf(deadtime, sizeof(deadtime), "%02ld:%02ld:%02ld", h, m, s);
 
        /* Neighbor State */
-       if (if_is_pointopoint(on->ospf6_if->interface))
+       if (on->ospf6_if->type == OSPF_IFTYPE_POINTOPOINT)
                snprintf(nstate, sizeof(nstate), "PointToPoint");
        else {
                if (on->router_id == on->drouter)