]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ospfd] CID #15, remove redundant NULL check in ism_change_state
authorPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:07:27 +0000 (23:07 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:07:27 +0000 (23:07 +0000)
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.

ospfd/ChangeLog
ospfd/ospf_ism.c

index 82e745cae293fd9cfbc554ae7631e59c9c541908..c9bdff65da618b65fb03435a57667b5c5c2be3bf 100644 (file)
        * ospf_ia.c: (ospf_update_router_route) ospf->backbone could be
          NULL when passed to ospf_find_asbr_route_through_area,
          check for NULL first, CID #14.
+       * 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.
 
 2006-05-11 Paul Jakma <paul.jakma@sun.com>
 
index f65c68c9dddbee59e16c76342f0a9fc70dcd5cde..0875e92dd037d3fcbcf04d34e9370a266b428695 100644 (file)
@@ -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)