summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast/pol
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2020-02-18 17:31:19 +0100
committerSander Vrijders <[email protected]>2020-02-23 14:37:27 +0100
commit00a8b8960c027848817050411e4c9be43cb6a427 (patch)
treed81d4e7a6d4f987a3cbc92bde7159a489ba97779 /src/ipcpd/unicast/pol
parentce2b6900e5373041fee62328e5d1c8a30e692ea2 (diff)
downloadouroboros-00a8b8960c027848817050411e4c9be43cb6a427.tar.gz
ouroboros-00a8b8960c027848817050411e4c9be43cb6a427.zip
ipcpd: Fix infinite recursion in LFA
There were bugs introduced in the LFA algorithm refactor causing infinite recursion and SEGV. The infinite recursion check was added as an explicit compiler flag to the build. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd/unicast/pol')
-rw-r--r--src/ipcpd/unicast/pol/graph.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipcpd/unicast/pol/graph.c b/src/ipcpd/unicast/pol/graph.c
index a3689ad6..ba2ce553 100644
--- a/src/ipcpd/unicast/pol/graph.c
+++ b/src/ipcpd/unicast/pol/graph.c
@@ -625,7 +625,7 @@ static int graph_routing_table_lfa(struct graph * graph,
int j;
int k;
- if (graph_routing_table_lfa(graph, s_addr, table, dist))
+ if (graph_routing_table_simple(graph, s_addr, table, dist))
goto fail_table;
for (j = 0; j < PROG_MAX_FLOWS; j++) {
@@ -677,7 +677,7 @@ static int graph_routing_table_lfa(struct graph * graph,
continue;
if (n_dist[j][v->index] <
- *dist[n_index[j]] + *dist[v->index])
+ (*dist)[n_index[j]] + (*dist)[v->index])
if (add_lfa_to_table(table, v->addr,
addrs[j]))
goto fail_add_lfa;