summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ospf6d/ospf6_area.c1
-rw-r--r--ospf6d/ospf6_spf.c13
2 files changed, 8 insertions, 6 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index 3c999bbc..bf8dbc33 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 04367f08..cb549618 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -392,18 +392,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;