From e55dd53bca98a032a583950320cc1367a0685bee Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Tue, 4 Jul 2006 13:46:14 +0000 Subject: [ospfd] trivial cleanup of nsm_timer_set 2006-07-02 Paul Jakma * ospf_nsm.c: (nsm_timer_set) ls_req timer should be OFF in early states. Compact several identical sections. Set inactivity timer to OFF for Down, for documentary purposes. --- ospfd/ChangeLog | 4 ++++ ospfd/ospf_nsm.c | 15 ++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index e3805c82..e6d04f32 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -7,6 +7,10 @@ next_state if the NSM tables do not indicate next_state is conditional, log warning if one tries - existing code appears fine though. + (nsm_timer_set) ls_req timer should be OFF in early states. + Compact several identical sections. + Set inactivity timer to OFF for Down, for documentary + purposes. 2006-06-30 Andrew J. Schorr diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c index 73ed088f..8c7c11a8 100644 --- a/ospfd/ospf_nsm.c +++ b/ospfd/ospf_nsm.c @@ -103,24 +103,21 @@ nsm_timer_set (struct ospf_neighbor *nbr) switch (nbr->state) { case NSM_Down: - OSPF_NSM_TIMER_OFF (nbr->t_db_desc); - OSPF_NSM_TIMER_OFF (nbr->t_ls_upd); - break; + /* This is here for documentation purposes, don't actually get here + * as Down neighbours are deleted typically, see nsm_kill_nbr + */ + OSPF_NSM_TIMER_OFF (nbr->t_inactivity); case NSM_Attempt: - OSPF_NSM_TIMER_OFF (nbr->t_db_desc); - OSPF_NSM_TIMER_OFF (nbr->t_ls_upd); - break; case NSM_Init: - OSPF_NSM_TIMER_OFF (nbr->t_db_desc); - OSPF_NSM_TIMER_OFF (nbr->t_ls_upd); - break; case NSM_TwoWay: OSPF_NSM_TIMER_OFF (nbr->t_db_desc); OSPF_NSM_TIMER_OFF (nbr->t_ls_upd); + OSPF_NSM_TIMER_OFF (nbr->t_ls_req); break; case NSM_ExStart: OSPF_NSM_TIMER_ON (nbr->t_db_desc, ospf_db_desc_timer, nbr->v_db_desc); OSPF_NSM_TIMER_OFF (nbr->t_ls_upd); + OSPF_NSM_TIMER_OFF (nbr->t_ls_req); break; case NSM_Exchange: OSPF_NSM_TIMER_ON (nbr->t_ls_upd, ospf_ls_upd_timer, nbr->v_ls_upd); -- cgit v1.2.1