[PATCH] src/graph.c: print bidirectional edges with a single two-headed arrow

tinc at eckner.net tinc at eckner.net
Sat Sep 28 09:22:35 CEST 2019


From: Erich Eckner <git at eckner.net>

Signed-off-by: Erich Eckner <git at eckner.net>
---
 src/graph.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/graph.c b/src/graph.c
index c63fdf9c..91f5c990 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -366,7 +366,13 @@ void dump_graph(void) {
 	/* now dump all edges */
 	for(node = edge_weight_tree->head; node; node = node->next) {
 		e = node->data;
-		fprintf(file, "	\"%s\" -> \"%s\";\n", e->from->name, e->to->name);
+		if (e->reverse) {
+			if (e->reverse > e)
+				fprintf(file, "	\"%s\" -> \"%s\" [dir=both];\n", e->from->name, e->to->name);
+		}
+		else {
+			fprintf(file, "	\"%s\" -> \"%s\";\n", e->from->name, e->to->name);
+		}
 	}
 
 	fprintf(file, "}\n");
-- 
2.23.0



More information about the tinc-devel mailing list