summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_spf.c
diff options
context:
space:
mode:
authorharios_niral <hari@niralnetworks.com>2020-10-07 22:38:43 -0700
committerharios_niral <hari@niralnetworks.com>2020-10-30 23:50:08 -0700
commitbeadc736bbd27da5d2bb6f2770fceea7af227ef3 (patch)
treecd3b630a3556f93fd68c80d087051882ae56e138 /ospf6d/ospf6_spf.c
parentc85b63238ae18baaabd833cdbfba79bba227a0e0 (diff)
ospf6d : Transformation changes for ospf6 vrf support.
1. All the changes are related to handle ospf6 with different vrf. 2. The dependancy of global ospf6 is removed. Co-authored-by: Kaushik <kaushik@niralnetworks.com> Signed-off-by: harios_niral <hari@niralnetworks.com>
Diffstat (limited to 'ospf6d/ospf6_spf.c')
-rw-r--r--ospf6d/ospf6_spf.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index bb6a050976..70164818a4 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -258,7 +258,7 @@ static char *ospf6_lsdesc_backlink(struct ospf6_lsa *lsa, caddr_t lsdesc,
}
static void ospf6_nexthop_calc(struct ospf6_vertex *w, struct ospf6_vertex *v,
- caddr_t lsdesc)
+ caddr_t lsdesc, struct ospf6 *ospf6)
{
int i;
ifindex_t ifindex;
@@ -316,7 +316,8 @@ static void ospf6_nexthop_calc(struct ospf6_vertex *w, struct ospf6_vertex *v,
}
static int ospf6_spf_install(struct ospf6_vertex *v,
- struct ospf6_route_table *result_table)
+ struct ospf6_route_table *result_table,
+ struct ospf6 *ospf6)
{
struct ospf6_route *route, *parent_route;
struct ospf6_vertex *prev;
@@ -419,11 +420,12 @@ static int ospf6_spf_install(struct ospf6_vertex *v,
listnode_add_sort(v->parent->child_list, v);
route->route_option = v;
- ospf6_route_add(route, result_table);
+ ospf6_route_add(route, result_table, ospf6);
return 0;
}
-void ospf6_spf_table_finish(struct ospf6_route_table *result_table)
+void ospf6_spf_table_finish(struct ospf6_route_table *result_table,
+ struct ospf6 *ospf6)
{
struct ospf6_route *route, *nroute;
struct ospf6_vertex *v;
@@ -431,7 +433,7 @@ void ospf6_spf_table_finish(struct ospf6_route_table *result_table)
nroute = ospf6_route_next(route);
v = (struct ospf6_vertex *)route->route_option;
ospf6_vertex_delete(v);
- ospf6_route_remove(route, result_table);
+ ospf6_route_remove(route, result_table, ospf6);
}
}
@@ -469,7 +471,7 @@ void ospf6_spf_calculation(uint32_t router_id,
struct ospf6_lsa *lsa;
struct in6_addr address;
- ospf6_spf_table_finish(result_table);
+ ospf6_spf_table_finish(result_table, oa->ospf6);
/* Install the calculating router itself as the root of the SPF tree */
/* construct root vertex */
@@ -498,7 +500,7 @@ void ospf6_spf_calculation(uint32_t router_id,
while ((v = vertex_pqueue_pop(&candidate_list))) {
/* installing may result in merging or rejecting of the vertex
*/
- if (ospf6_spf_install(v, result_table) < 0)
+ if (ospf6_spf_install(v, result_table, oa->ospf6) < 0)
continue;
/* Skip overloaded routers */
@@ -544,7 +546,7 @@ void ospf6_spf_calculation(uint32_t router_id,
w->nh_list,
ROUTER_LSDESC_GET_IFID(lsdesc), NULL);
else if (w->hops == 1 && v->hops == 0)
- ospf6_nexthop_calc(w, v, lsdesc);
+ ospf6_nexthop_calc(w, v, lsdesc, oa->ospf6);
else
ospf6_copy_nexthops(w->nh_list, v->nh_list);
@@ -915,7 +917,7 @@ int config_write_ospf6_debug_spf(struct vty *vty)
return 0;
}
-void ospf6_spf_config_write(struct vty *vty)
+void ospf6_spf_config_write(struct vty *vty, struct ospf6 *ospf6)
{
if (ospf6->spf_delay != OSPF_SPF_DELAY_DEFAULT