From f09adc21926cef760b98ac0ebbf6633b201aa038 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 10 Dec 2018 22:04:37 +0000 Subject: [PATCH] Update getRoutes format --- src/yggdrasil/admin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yggdrasil/admin.go b/src/yggdrasil/admin.go index dea4577a..253a9bfb 100644 --- a/src/yggdrasil/admin.go +++ b/src/yggdrasil/admin.go @@ -268,11 +268,11 @@ func (a *admin) init(c *Core, listenaddr string) { return admin_info{"source_subnets": subnets}, nil }) a.addHandler("getRoutes", []string{}, func(in admin_info) (admin_info, error) { - var routes []string + routes := make(admin_info) a.core.router.doAdmin(func() { getRoutes := func(ckrs []cryptokey_route) { for _, ckr := range ckrs { - routes = append(routes, fmt.Sprintf("%s via %s", ckr.subnet.String(), hex.EncodeToString(ckr.destination[:]))) + routes[ckr.subnet.String()] = hex.EncodeToString(ckr.destination[:]) } } getRoutes(a.core.router.cryptokey.ipv4routes)