]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospf6d: Route locking (memory) cleanup
authorTom Goff <thomas.goff@boeing.com>
Wed, 10 Nov 2010 21:03:02 +0000 (13:03 -0800)
committerPaul Jakma <paul@quagga.net>
Mon, 21 Mar 2011 13:31:16 +0000 (13:31 +0000)
* ospf6_route.c: (ospf6_route_best_next) Allows unlock route, even
  when there's no next route.  This is consistent with how
  ospf6_route_next() behaves.

* ospf6_intra.c: (ospf6_intra_prefix_lsa_remove) Make sure the last
  route considered is always unlocked.  This is needed when the for
  loop terminates because ospf6_route_is_prefix() returns zero.

ospf6d/ospf6_intra.c
ospf6d/ospf6_route.c

index 05b11ba36f9e73a2386a5056e1ed6d9718677d2d..9bc603b307b5528acbf07e7cae2646d3fb3407b3 100644 (file)
@@ -1177,6 +1177,8 @@ ospf6_intra_prefix_lsa_remove (struct ospf6_lsa *lsa)
             }
           ospf6_route_remove (route, oa->route_table);
         }
+      if (route)
+       ospf6_route_unlock (route);
     }
 
   if (current != end && IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX))
index 1e1f4fb5aae0080e788416ed306f071c10aaad7a..b13897d54a8424b32703caeac8655f8e967cb880 100644 (file)
@@ -690,6 +690,8 @@ ospf6_route_best_next (struct ospf6_route *route)
   struct route_node *rnode;
   struct ospf6_route *next;
 
+  ospf6_route_unlock (route);
+
   rnode = route->rnode;
   route_lock_node (rnode);
   rnode = route_next (rnode);
@@ -701,7 +703,6 @@ ospf6_route_best_next (struct ospf6_route *route)
 
   assert (rnode->info);
   next = (struct ospf6_route *) rnode->info;
-  ospf6_route_unlock (route);
   ospf6_route_lock (next);
   return next;
 }