From 25661ebcad4473c1a1a99894f77147d8b6be15dd Mon Sep 17 00:00:00 2001 From: Arceliar Date: Tue, 4 Sep 2018 19:30:07 -0500 Subject: [PATCH] fix 0 port number on links to unknown nodes in the admin dot graph --- src/yggdrasil/admin.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/yggdrasil/admin.go b/src/yggdrasil/admin.go index b0d487a..c8748e8 100644 --- a/src/yggdrasil/admin.go +++ b/src/yggdrasil/admin.go @@ -656,6 +656,16 @@ func (a *admin) getResponse_dot() []byte { newInfo.name = "?" newInfo.key = key newInfo.options = "fontname=\"sans serif\" style=dashed color=\"#999999\" fontcolor=\"#999999\"" + + coordsSplit := coordSlice(newInfo.key) + if len(coordsSplit) != 0 { + portStr := coordsSplit[len(coordsSplit)-1] + portUint, err := strconv.ParseUint(portStr, 10, 64) + if err == nil { + newInfo.port = switchPort(portUint) + } + } + infos[key] = newInfo } }