mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-26 15:05:50 +03:00
/install/get_default_addresses -- Remove subnet suffix from addresses
This commit is contained in:
parent
d97c426646
commit
c14aff3dba
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue