ospf6d: reinvoke MaxAge remover thread if not all MaxAge LSAs were flushed.
MaxAge LSAs are being flushed out only on an event, unlike OSPFv2 where they're flushed out
periodically. This causes certain LSAs to hang around forever, never getting flushed out.
This patch makes flushing out MaxAge LSAs periodic, retriggered after a certain period if
not all MaxAge LSAs were flushed out.
Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c
index 7455d83..0edc7a3 100644
--- a/ospf6d/ospf6_lsdb.c
+++ b/ospf6d/ospf6_lsdb.c
@@ -481,6 +481,29 @@
ospf6_lsdb_remove (lsa, lsdb);
}
+int
+ospf6_lsdb_maxage_remover (struct ospf6_lsdb *lsdb)
+{
+ int reschedule = 0;
+ struct ospf6_lsa *lsa;
+
+ for (lsa = ospf6_lsdb_head (lsdb); lsa; lsa = ospf6_lsdb_next (lsa))
+ {
+ if (! OSPF6_LSA_IS_MAXAGE (lsa))
+ continue;
+ if (lsa->retrans_count != 0)
+ {
+ reschedule = 1;
+ continue;
+ }
+ if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type))
+ zlog_debug ("Remove MaxAge %s", lsa->name);
+ ospf6_lsdb_remove (lsa, lsdb);
+ }
+
+ return (reschedule);
+}
+
void
ospf6_lsdb_show (struct vty *vty, int level,
u_int16_t *type, u_int32_t *id, u_int32_t *adv_router,