ospfd: Unify router and network LSA refresh logic with general refresher
* (general) Get rid of the router and network LSA specific refresh timers
and make the general refresher do this instead. Get rid of the twiddling
of timers for router/network LSA that was spread across the code.
This lays the foundations for future, general LSA refresh improvements,
such as making sequence rollover work, and having generic LSA delays.
* ospfd.h: (struct ospf) Bye bye to the router-lsa update timer thread
pointer.
(struct ospf_area) and to the router-lsa refresh timer.
* ospf_interface.h: Remove the network_lsa_self timer thread pointer
* ospf_lsa.h: (struct ospf_lsa) oi field should always be there, for benefit
of type-2/network LSA processing.
(ospf_{router,network}_lsa_{update_timer,timer_add}) no timers for these
more
(ospf_{router,network}_lsa_update) more generic functions to indicate that some
router/network LSAs need updating
(ospf_router_lsa_update_area) update router lsa in a particular area alone.
(ospf_{summary,summary_asbr,network}_lsa_refresh) replaced by the general
ospf_lsa_refresh function.
(ospf_lsa_refresh) general LSA refresh function
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index a7553e7..7db81ce 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -131,8 +131,8 @@
ospf->external_origin = 0;
}
- OSPF_TIMER_ON (ospf->t_router_lsa_update,
- ospf_router_lsa_update_timer, OSPF_LSA_UPDATE_DELAY);
+ /* update router-lsa's for each area */
+ ospf_router_lsa_update (ospf);
/* update ospf_interface's */
for (ALL_LIST_ELEMENTS_RO (om->iflist, node, ifp))
@@ -337,7 +337,7 @@
SET_FLAG (area->stub_router_state, OSPF_AREA_ADMIN_STUB_ROUTED);
if (!CHECK_FLAG (area->stub_router_state, OSPF_AREA_IS_STUB_ROUTED))
- ospf_router_lsa_timer_add (area);
+ ospf_router_lsa_update_area (area);
}
timeout = ospf->stub_router_shutdown_time;
}
@@ -473,7 +473,6 @@
/* Cancel all timers. */
OSPF_TIMER_OFF (ospf->t_external_lsa);
- OSPF_TIMER_OFF (ospf->t_router_lsa_update);
OSPF_TIMER_OFF (ospf->t_spf_calc);
OSPF_TIMER_OFF (ospf->t_ase_calc);
OSPF_TIMER_OFF (ospf->t_maxage);
@@ -631,7 +630,6 @@
free (IMPORT_NAME (area));
/* Cancel timer. */
- OSPF_TIMER_OFF (area->t_router_lsa_self);
OSPF_TIMER_OFF (area->t_stub_router);
#ifdef HAVE_OPAQUE_LSA
OSPF_TIMER_OFF (area->t_opaque_lsa_self);
@@ -1041,7 +1039,7 @@
break;
}
- ospf_router_lsa_timer_add (area);
+ ospf_router_lsa_update_area (area);
ospf_schedule_abr_task (area->ospf);
}
@@ -1052,7 +1050,7 @@
return 0;
area->shortcut_configured = mode;
- ospf_router_lsa_timer_add (area);
+ ospf_router_lsa_update_area (area);
ospf_schedule_abr_task (ospf);
ospf_area_check_free (ospf, area->area_id);
@@ -1064,7 +1062,7 @@
ospf_area_shortcut_unset (struct ospf *ospf, struct ospf_area *area)
{
area->shortcut_configured = OSPF_SHORTCUT_DEFAULT;
- ospf_router_lsa_timer_add (area);
+ ospf_router_lsa_update_area (area);
ospf_area_check_free (ospf, area->area_id);
ospf_schedule_abr_task (ospf);