summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_ti_lfa.c
diff options
context:
space:
mode:
authorGalaxyGorilla <sascha@netdef.org>2020-10-13 13:53:04 +0200
committerGalaxyGorilla <sascha@netdef.org>2021-01-19 16:32:13 +0100
commit133e59cfad8700d3fb71484ff574ab9fdc73299e (patch)
tree6c89801478bde23696f2df60718522656ba143fb /ospfd/ospf_ti_lfa.c
parentospfd: TI-LFA basic infrastructure and algorithms (diff)
downloadfrr-133e59cfad8700d3fb71484ff574ab9fdc73299e.tar.xz
frr-133e59cfad8700d3fb71484ff574ab9fdc73299e.zip
ospfd: Add support for reverse SPF (P2P only)
A reverse SPF is important in the context of TI-LFA, e.g. for computing so called Q spaces. In case the weights of the links are symmetric there is no difference to the 'normal' SPF and hence this patch is really just needed for the case with asymmetric link weights. Signed-off-by: GalaxyGorilla <sascha@netdef.org>
Diffstat (limited to 'ospfd/ospf_ti_lfa.c')
-rw-r--r--ospfd/ospf_ti_lfa.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ospfd/ospf_ti_lfa.c b/ospfd/ospf_ti_lfa.c
index 61c278575..b0a10845c 100644
--- a/ospfd/ospf_ti_lfa.c
+++ b/ospfd/ospf_ti_lfa.c
@@ -249,11 +249,15 @@ static void ospf_ti_lfa_generate_q_spaces(struct ospf_area *area,
new_rtrs = route_table_init();
/*
- * Generate a new SPF tree for this vertex,
+ * 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, new_rtrs, true, false);
+ /* Reset the flag for reverse SPF */
+ area->spf_reversed = false;
+
q_space->root = area->spf;
q_space->vertex_list = area->spf_vertex_list;
q_space->label_stack = NULL;