From c363d3861b5384a31465a72ddc3b0f6ff007a95a Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Sun, 24 Jan 2010 22:42:13 +0000 Subject: 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 --- ospfd/ospfd.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'ospfd/ospfd.c') diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index a7553e73..7db81cea 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -131,8 +131,8 @@ ospf_router_id_update (struct ospf *ospf) 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 @@ ospf_deferred_shutdown_check (struct ospf *ospf) 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 @@ ospf_finish_final (struct ospf *ospf) /* 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 @@ ospf_area_free (struct ospf_area *area) 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 @@ ospf_area_type_set (struct ospf_area *area, int type) break; } - ospf_router_lsa_timer_add (area); + ospf_router_lsa_update_area (area); ospf_schedule_abr_task (area->ospf); } @@ -1052,7 +1050,7 @@ ospf_area_shortcut_set (struct ospf *ospf, struct ospf_area *area, int mode) 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 @@ int 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); -- cgit v1.2.1