summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/pol
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/normal/pol')
-rw-r--r--src/ipcpd/normal/pol/graph.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ipcpd/normal/pol/graph.c b/src/ipcpd/normal/pol/graph.c
index 3611f0b0..9901fbaa 100644
--- a/src/ipcpd/normal/pol/graph.c
+++ b/src/ipcpd/normal/pol/graph.c
@@ -454,9 +454,10 @@ ssize_t graph_routing_table(struct graph * graph,
pthread_mutex_lock(&graph->lock);
- if (graph->nr_vertices == 0) {
+ /* We need at least 2 vertices for a table */
+ if (graph->nr_vertices < 2) {
pthread_mutex_unlock(&graph->lock);
- return 0;
+ return -1;
}
prevs = dijkstra(graph, s_addr);