From deb1561c1824d0a5215c8fcd0084393090a6567e Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 12 May 2006 23:07:27 +0000 Subject: [ospfd] CID #15, remove redundant NULL check in ism_change_state 2006-05-12 Paul Jakma * ospf_ism.c: (ism_change_state) NULL check on oi->area is useless, it's always valid. Only possibility where it couldn't be is if there is a race between abr_task and cleaning up oi's, in which case a NULL check here isn't going to do anything. Fixes CID #15. --- ospfd/ospf_ism.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'ospfd/ospf_ism.c') diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c index f65c68c9..0875e92d 100644 --- a/ospfd/ospf_ism.c +++ b/ospfd/ospf_ism.c @@ -569,19 +569,16 @@ ism_change_state (struct ospf_interface *oi, int state) ospf_check_abr_status (oi->ospf); /* Originate router-LSA. */ - if (oi->area) + if (state == ISM_Down) { - if (state == ISM_Down) - { - if (oi->area->act_ints > 0) - oi->area->act_ints--; - } - else if (old_state == ISM_Down) - oi->area->act_ints++; - - /* schedule router-LSA originate. */ - ospf_router_lsa_timer_add (oi->area); + if (oi->area->act_ints > 0) + oi->area->act_ints--; } + else if (old_state == ISM_Down) + oi->area->act_ints++; + + /* schedule router-LSA originate. */ + ospf_router_lsa_timer_add (oi->area); /* Originate network-LSA. */ if (old_state != ISM_DR && state == ISM_DR) -- cgit v1.2.3 From 1fe6ed38cd0136c514aabae01389653beab27fb9 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Wed, 26 Jul 2006 09:37:26 +0000 Subject: [ospfd] Allow ospf_lsa_unlock to NULL out callers' LSA pointers upon free 2006-07-26 Paul Jakma * ospf_lsa.{c,h}: (ospf_lsa_unlock) Change to take a double pointer to the LSA to be 'unlocked', so that, if the LSA is freed, the callers pointer to the LSA can be NULLed out, allowing any further use of that pointer to provoke a crash sooner rather than later. * ospf_*.c: (general) Adjust callers of ospf_lsa_unlock to match previous. Try annotate 'locking' somewhat to show which 'locks' are protecting what LSA reference, if not obvious. * ospf_opaque.c: (ospf_opaque_lsa_install) Trivial: remove useless goto, replace with return. * ospf_packet.c: (ospf_make_ls_ack) Trivial: merge two list loops, the dual-loop predated the delete-safe list-loop macro. --- ospfd/ospf_ism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ospfd/ospf_ism.c') diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c index 0875e92d..829ea00a 100644 --- a/ospfd/ospf_ism.c +++ b/ospfd/ospf_ism.c @@ -593,7 +593,7 @@ ism_change_state (struct ospf_interface *oi, int state) OSPF_TIMER_OFF (oi->t_network_lsa_self); } - ospf_lsa_unlock (oi->network_lsa_self); + ospf_lsa_unlock (&oi->network_lsa_self); oi->network_lsa_self = NULL; } -- cgit v1.2.3 From 30a2231a4881f53deca61ef7a62b225a43dab4c5 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 15 Aug 2008 14:05:22 +0100 Subject: [warnings] Fix various SOS warnings 2008-08-15 Paul Jakma * */*: Fix various problems flagged by Sun Studio compiler. - ' ' obsolescent in declarations - empty statements (';' after ALIAS definitions) - implicit declarations (e.g printstack in lib/log.c) - "\%" in printf string instead of "%%" - loops that return on the first iteration (legitimately, but compiler can't really know), e.g. bgp_routemap.c - internal declarations which mask prototypes. --- ospfd/ospf_ism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ospfd/ospf_ism.c') diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c index 829ea00a..f215bfc2 100644 --- a/ospfd/ospf_ism.c +++ b/ospfd/ospf_ism.c @@ -520,7 +520,7 @@ struct { }, }; -const static char *ospf_ism_event_str[] = +static const char *ospf_ism_event_str[] = { "NoEvent", "InterfaceUp", -- cgit v1.2.3