From c14aff3dba1f6e6213e93189d51ca008e25a2f3a Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Fri, 1 Feb 2019 18:38:52 +0300 Subject: [PATCH] /install/get_default_addresses -- Remove subnet suffix from addresses --- control.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/control.go b/control.go index e174c622..66ea1a27 100644 --- a/control.go +++ b/control.go @@ -737,6 +737,13 @@ func handleGetDefaultAddresses(w http.ResponseWriter, r *http.Request) { data.Interfaces = make(map[string]interface{}) for _, iface := range ifaces { + for i := range iface.Addresses { + ip, _, err := net.ParseCIDR(iface.Addresses[i]) + if err != nil { + continue + } + iface.Addresses[i] = ip.String() + } data.Interfaces[iface.Name] = iface }