ospfd: Fix ospf_ti_lfa drop of an entire table

The new_rtrs variable was just generated and then dropped.  Let's
fix that entirely

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-03-17 10:37:40 -04:00
parent 3bf4d3b45d
commit eb7e14011f
2 changed files with 9 additions and 13 deletions

View File

@ -1764,7 +1764,8 @@ void ospf_spf_calculate(struct ospf_area *area, struct ospf_lsa *root_lsa,
if (v->type != OSPF_VERTEX_ROUTER)
ospf_intra_add_transit(new_table, v, area);
else {
ospf_intra_add_router(new_rtrs, v, area, false);
if (new_rtrs)
ospf_intra_add_router(new_rtrs, v, area, false);
if (all_rtrs)
ospf_intra_add_router(all_rtrs, v, area, true);
}

View File

@ -237,7 +237,7 @@ static void ospf_ti_lfa_generate_inner_label_stack(
struct q_space *q_space,
struct ospf_ti_lfa_inner_backup_path_info *inner_backup_path_info)
{
struct route_table *new_table, *new_rtrs;
struct route_table *new_table;
struct vertex *q_node;
struct vertex *start_vertex, *end_vertex;
struct vertex_parent *vertex_parent;
@ -300,7 +300,6 @@ static void ospf_ti_lfa_generate_inner_label_stack(
start_vertex, end_vertex);
new_table = route_table_init();
new_rtrs = route_table_init();
/* Copy the current state ... */
spf_orig = area->spf;
@ -311,7 +310,7 @@ static void ospf_ti_lfa_generate_inner_label_stack(
XCALLOC(MTYPE_OSPF_P_SPACE, sizeof(struct p_spaces_head));
/* dry run true, root node false */
ospf_spf_calculate(area, start_vertex->lsa_p, new_table, NULL, new_rtrs,
ospf_spf_calculate(area, start_vertex->lsa_p, new_table, NULL, NULL,
true, false);
q_node = ospf_spf_vertex_find(end_vertex->id, area->spf_vertex_list);
@ -622,7 +621,7 @@ static void ospf_ti_lfa_generate_q_spaces(struct ospf_area *area,
{
struct listnode *node;
struct vertex *child;
struct route_table *new_table, *new_rtrs;
struct route_table *new_table;
struct q_space *q_space, q_space_search;
char label_buf[MPLS_LABEL_STRLEN];
char res_buf[PROTECTED_RESOURCE_STRLEN];
@ -661,15 +660,13 @@ static void ospf_ti_lfa_generate_q_spaces(struct ospf_area *area,
sizeof(struct ospf_ti_lfa_node_info));
new_table = route_table_init();
/* XXX do these get freed?? */
new_rtrs = route_table_init();
/*
* Generate a new (reversed!) SPF tree for this vertex,
* dry run true, root node false
*/
area->spf_reversed = true;
ospf_spf_calculate(area, dest->lsa_p, new_table, NULL, new_rtrs, true,
ospf_spf_calculate(area, dest->lsa_p, new_table, NULL, NULL, true,
false);
/* Reset the flag for reverse SPF */
@ -734,11 +731,9 @@ static void ospf_ti_lfa_generate_q_spaces(struct ospf_area *area,
static void ospf_ti_lfa_generate_post_convergence_spf(struct ospf_area *area,
struct p_space *p_space)
{
struct route_table *new_table, *new_rtrs;
struct route_table *new_table;
new_table = route_table_init();
/* XXX do these get freed?? */
new_rtrs = route_table_init();
area->spf_protected_resource = p_space->protected_resource;
@ -757,8 +752,8 @@ static void ospf_ti_lfa_generate_post_convergence_spf(struct ospf_area *area,
* endeavour (because LSAs are stored as a 'raw' stream), so we go with
* this rather hacky way for now.
*/
ospf_spf_calculate(area, area->router_lsa_self, new_table, NULL,
new_rtrs, true, false);
ospf_spf_calculate(area, area->router_lsa_self, new_table, NULL, NULL,
true, false);
p_space->pc_spf = area->spf;
p_space->pc_vertex_list = area->spf_vertex_list;