/install/get_default_addresses -- Remove subnet suffix from addresses

This commit is contained in:
Eugene Bujak 2019-02-01 18:38:52 +03:00
parent d97c426646
commit c14aff3dba
1 changed files with 7 additions and 0 deletions

View File

@ -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
}