]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Fix ospf_ti_lfa drop of an entire table
authorDonald Sharp <sharpd@nvidia.com>
Fri, 17 Mar 2023 14:37:40 +0000 (10:37 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 17 Mar 2023 14:37:40 +0000 (10:37 -0400)
The new_rtrs variable was just generated and then dropped.  Let's
fix that entirely

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospfd/ospf_spf.c
ospfd/ospf_ti_lfa.c

index 7c1f9f17ac3c994a3508cb23a12b2e815297927e..f731d1cf18060e24f8878973fbb906378a4b0dbe 100644 (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);
                }
index b14200868ee1b6b3f69b9e7b6a98c221a76df2ef..385428f8e67604e6b5ff673439ca0699b0222cd2 100644 (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;