summaryrefslogtreecommitdiff
path: root/ospfd/ospf_ti_lfa.c
diff options
context:
space:
mode:
authorGalaxyGorilla <sascha@netdef.org>2020-10-13 11:53:04 +0000
committerGalaxyGorilla <sascha@netdef.org>2021-01-19 15:32:13 +0000
commit133e59cfad8700d3fb71484ff574ab9fdc73299e (patch)
tree6c89801478bde23696f2df60718522656ba143fb /ospfd/ospf_ti_lfa.c
parent7fd0729f762d96ca78057ed126afdaacc0dd1fd9 (diff)
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 61c278575c..b0a10845c5 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;