[quagga-dev 8357] Re: [PATCH 6/7] ospf6d: Route locking (memory) cleanup

Balaji G balajig81 at gmail.com
Tue Nov 16 11:13:43 GMT 2010


Applied, Thanks

On Thu, Nov 11, 2010 at 2:33 AM, Tom Goff <thomas.goff at boeing.com> wrote:

> * 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.
>
> Signed-off-by: Tom Goff <thomas.goff at boeing.com>
> ---
>  ospf6d/ospf6_intra.c |    2 ++
>  ospf6d/ospf6_route.c |    3 ++-
>  2 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
> index 05b11ba..9bc603b 100644
> --- a/ospf6d/ospf6_intra.c
> +++ b/ospf6d/ospf6_intra.c
> @@ -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))
> diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
> index 2d02710..398acfa 100644
> --- a/ospf6d/ospf6_route.c
> +++ b/ospf6d/ospf6_route.c
> @@ -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;
>  }
> --
> 1.7.0.4
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev at lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20101116/e31d2b18/attachment-0001.html>


More information about the Quagga-dev mailing list