summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_top.c
diff options
context:
space:
mode:
authorDinesh Dutt <ddutt@cumulusnetworks.com>2013-08-24 09:54:17 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2013-11-08 03:15:42 +0100
commit2449fcd64ae95d5fbfd95d93468fc57003def57d (patch)
tree8c152a482f2080ee425cd06381861d2bf69769d4 /ospf6d/ospf6_top.c
parentospf6d: schedule SPF to run on events rather than directly on each event. (diff)
downloadfrr-2449fcd64ae95d5fbfd95d93468fc57003def57d.tar.xz
frr-2449fcd64ae95d5fbfd95d93468fc57003def57d.zip
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>
Diffstat (limited to 'ospf6d/ospf6_top.c')
-rw-r--r--ospf6d/ospf6_top.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 540ef382e..e9fe7a4e9 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -208,7 +208,7 @@ ospf6_disable (struct ospf6 *o)
}
}
-static int
+int
ospf6_maxage_remover (struct thread *thread)
{
struct ospf6 *o = (struct ospf6 *) THREAD_ARG (thread);
@@ -216,6 +216,7 @@ ospf6_maxage_remover (struct thread *thread)
struct ospf6_interface *oi;
struct ospf6_neighbor *on;
struct listnode *i, *j, *k;
+ int reschedule = 0;
o->maxage_remover = (struct thread *) NULL;
@@ -227,8 +228,9 @@ ospf6_maxage_remover (struct thread *thread)
{
if (on->state != OSPF6_NEIGHBOR_EXCHANGE &&
on->state != OSPF6_NEIGHBOR_LOADING)
- continue;
+ continue;
+ ospf6_maxage_remove (o);
return 0;
}
}
@@ -237,11 +239,28 @@ ospf6_maxage_remover (struct thread *thread)
for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
{
for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
- OSPF6_LSDB_MAXAGE_REMOVER (oi->lsdb);
+ {
+ if (ospf6_lsdb_maxage_remover (oi->lsdb))
+ {
+ reschedule = 1;
+ }
+ }
- OSPF6_LSDB_MAXAGE_REMOVER (oa->lsdb);
+ if (ospf6_lsdb_maxage_remover (oa->lsdb))
+ {
+ reschedule = 1;
+ }
+ }
+
+ if (ospf6_lsdb_maxage_remover (o->lsdb))
+ {
+ reschedule = 1;
+ }
+
+ if (reschedule)
+ {
+ ospf6_maxage_remove (o);
}
- OSPF6_LSDB_MAXAGE_REMOVER (o->lsdb);
return 0;
}
@@ -250,7 +269,8 @@ void
ospf6_maxage_remove (struct ospf6 *o)
{
if (o && ! o->maxage_remover)
- o->maxage_remover = thread_add_event (master, ospf6_maxage_remover, o, 0);
+ o->maxage_remover = thread_add_timer (master, ospf6_maxage_remover, o,
+ OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT);
}
/* start ospf6 */