[prev in list] [next in list] [prev in thread] [next in thread]
List: quagga-dev
Subject: [quagga-dev 8354] Re: [PATCH 5/7] ospf6d: Memory cleanup
From: Balaji G <balajig81 () gmail ! com>
Date: 2010-11-16 6:30:24
Message-ID: AANLkTik-sibAfZsRdGNKvg0zUvucjV4Lc1OtxFVpz+fA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Applied,
Though i have applied it i cannot validate these changes myself as i have
not gone through the ospf code.
Cheers,
- Balaji
On Thu, Nov 11, 2010 at 2:32 AM, Tom Goff <thomas.goff@boeing.com> wrote:
> * ospf6_area.c: Call ospf6_spf_table_finish() before deleting the spf
> table. This ensures that the associated ospf6_vertex structures
> are also freed.
>
> * ospf6_spf.c: Only allocate a priority queue when a spf calculation
> is actually performed. Also defer calling ospf6_spf_table_finish().
>
> Signed-off-by: Tom Goff <thomas.goff@boeing.com>
> ---
> ospf6d/ospf6_area.c | 1 +
> ospf6d/ospf6_spf.c | 13 +++++++------
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
> index 3c999bb..bf8dbc3 100644
> --- a/ospf6d/ospf6_area.c
> +++ b/ospf6d/ospf6_area.c
> @@ -199,6 +199,7 @@ ospf6_area_delete (struct ospf6_area *oa)
> ospf6_lsdb_delete (oa->lsdb);
> ospf6_lsdb_delete (oa->lsdb_self);
>
> + ospf6_spf_table_finish (oa->spf_table);
> ospf6_route_table_delete (oa->spf_table);
> ospf6_route_table_delete (oa->route_table);
>
> diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
> index bfb6df2..d501c54 100644
> --- a/ospf6d/ospf6_spf.c
> +++ b/ospf6d/ospf6_spf.c
> @@ -404,18 +404,19 @@ ospf6_spf_calculation (u_int32_t router_id,
> caddr_t lsdesc;
> struct ospf6_lsa *lsa;
>
> - /* initialize */
> - candidate_list = pqueue_create ();
> - candidate_list->cmp = ospf6_vertex_cmp;
> -
> - ospf6_spf_table_finish (result_table);
> -
> /* Install the calculating router itself as the root of the SPF tree */
> /* construct root vertex */
> lsa = ospf6_lsdb_lookup (htons (OSPF6_LSTYPE_ROUTER), htonl (0),
> router_id, oa->lsdb);
> if (lsa == NULL)
> return;
> +
> + /* initialize */
> + candidate_list = pqueue_create ();
> + candidate_list->cmp = ospf6_vertex_cmp;
> +
> + ospf6_spf_table_finish (result_table);
> +
> root = ospf6_vertex_create (lsa);
> root->area = oa;
> root->cost = 0;
> --
> 1.7.0.4
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev@lists.quagga.net
> http://lists.quagga.net/mailman/listinfo/quagga-dev
>
[Attachment #5 (text/html)]
Applied, <div><br></div><div>Though i have applied it i cannot validate these \
changes myself as i have not gone through the ospf code. \
</div><div><br></div><div>Cheers,</div><div> - Balaji<br><br><div \
class="gmail_quote"> On Thu, Nov 11, 2010 at 2:32 AM, Tom Goff <span dir="ltr"><<a \
href="mailto:thomas.goff@boeing.com">thomas.goff@boeing.com</a>></span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;">
* ospf6_area.c: Call ospf6_spf_table_finish() before deleting the spf<br>
table. This ensures that the associated ospf6_vertex structures<br>
are also freed.<br>
<br>
* ospf6_spf.c: Only allocate a priority queue when a spf calculation<br>
is actually performed. Also defer calling ospf6_spf_table_finish().<br>
<br>
Signed-off-by: Tom Goff <<a \
href="mailto:thomas.goff@boeing.com">thomas.goff@boeing.com</a>><br>
---<br>
ospf6d/ospf6_area.c | 1 +<br>
ospf6d/ospf6_spf.c | 13 +++++++------<br>
2 files changed, 8 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c<br>
index 3c999bb..bf8dbc3 100644<br>
--- a/ospf6d/ospf6_area.c<br>
+++ b/ospf6d/ospf6_area.c<br>
@@ -199,6 +199,7 @@ ospf6_area_delete (struct ospf6_area *oa)<br>
ospf6_lsdb_delete (oa->lsdb);<br>
ospf6_lsdb_delete (oa->lsdb_self);<br>
<br>
+ ospf6_spf_table_finish (oa->spf_table);<br>
ospf6_route_table_delete (oa->spf_table);<br>
ospf6_route_table_delete (oa->route_table);<br>
<br>
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c<br>
index bfb6df2..d501c54 100644<br>
--- a/ospf6d/ospf6_spf.c<br>
+++ b/ospf6d/ospf6_spf.c<br>
@@ -404,18 +404,19 @@ ospf6_spf_calculation (u_int32_t router_id,<br>
caddr_t lsdesc;<br>
struct ospf6_lsa *lsa;<br>
<br>
- /* initialize */<br>
- candidate_list = pqueue_create ();<br>
- candidate_list->cmp = ospf6_vertex_cmp;<br>
-<br>
- ospf6_spf_table_finish (result_table);<br>
-<br>
/* Install the calculating router itself as the root of the SPF tree */<br>
/* construct root vertex */<br>
lsa = ospf6_lsdb_lookup (htons (OSPF6_LSTYPE_ROUTER), htonl (0),<br>
router_id, oa->lsdb);<br>
if (lsa == NULL)<br>
return;<br>
+<br>
+ /* initialize */<br>
+ candidate_list = pqueue_create ();<br>
+ candidate_list->cmp = ospf6_vertex_cmp;<br>
+<br>
+ ospf6_spf_table_finish (result_table);<br>
+<br>
root = ospf6_vertex_create (lsa);<br>
root->area = oa;<br>
root->cost = 0;<br>
<font color="#888888">--<br>
1.7.0.4<br>
<br>
_______________________________________________<br>
Quagga-dev mailing list<br>
<a href="mailto:Quagga-dev@lists.quagga.net">Quagga-dev@lists.quagga.net</a><br>
<a href="http://lists.quagga.net/mailman/listinfo/quagga-dev" \
target="_blank">http://lists.quagga.net/mailman/listinfo/quagga-dev</a><br> \
</font></blockquote></div><br></div>
_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
http://lists.quagga.net/mailman/listinfo/quagga-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic