[ospfd] CID #15, remove redundant NULL check in ism_change_state
2006-05-12 Paul Jakma <paul.jakma@sun.com>
* 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.
diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c
index f65c68c..0875e92 100644
--- a/ospfd/ospf_ism.c
+++ b/ospfd/ospf_ism.c
@@ -569,19 +569,16 @@
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)