summaryrefslogtreecommitdiffstats
path: root/isisd/isis_lfa.c
diff options
context:
space:
mode:
authorFredi Raspall <fredi@voltanet.io>2021-04-24 00:01:41 +0200
committerFredi Raspall <fredi@voltanet.io>2021-05-01 15:52:10 +0200
commit7c3be15f3e8e554a3ce57eb1a3b69ea349c34f03 (patch)
tree7135c52369207dce9715508f886f721549e5cc03 /isisd/isis_lfa.c
parentMerge pull request #8576 from pguibert6WIND/macvlan_crash (diff)
downloadfrr-7c3be15f3e8e554a3ce57eb1a3b69ea349c34f03.tar.xz
frr-7c3be15f3e8e554a3ce57eb1a3b69ea349c34f03.zip
isisd: fix memory leak for non-freed spftrees
When enabling TI-LFA the forward SPF for neighbors adjacent to the PLR is computed. Later, when computing the PQ spaces, the reverse SPF trees for those adjacent neighbors affected by the protected interface are computed. When node protection is enabled, TI-LFA link protection is run immediately afterwards to compute repairs in case no node-protecting backup path exists. In this second run, the existing code tries to compute the reverse SPF tree for the same node, without freeing the SPF tree of the prior run. This patch fixes this by not computing the reverse SPF again, thus avoiding a memory leak and an unnecessary SPF run. Signed-off-by: Fredi Raspall <fredi@voltanet.io>
Diffstat (limited to '')
-rw-r--r--isisd/isis_lfa.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/isisd/isis_lfa.c b/isisd/isis_lfa.c
index 085177b94..b535924e9 100644
--- a/isisd/isis_lfa.c
+++ b/isisd/isis_lfa.c
@@ -1148,10 +1148,13 @@ static void lfa_calc_pq_spaces(struct isis_spftree *spftree_pc,
/*
* Compute the reverse SPF in the behalf of the node
- * adjacent to the failure.
+ * adjacent to the failure, if we haven't done that
+ * before
*/
- adj_node->lfa.spftree_reverse =
- isis_spf_reverse_run(adj_node->lfa.spftree);
+ if (!adj_node->lfa.spftree_reverse)
+ adj_node->lfa.spftree_reverse =
+ isis_spf_reverse_run(
+ adj_node->lfa.spftree);
lfa_calc_reach_nodes(adj_node->lfa.spftree_reverse,
spftree_reverse, adj_nodes, false,