fix dupplicates addreses on babel

This commit is contained in:
Martin/Geno 2019-05-19 00:51:42 +02:00 committed by genofire
parent 5d03c7488d
commit a2ec45e025
No known key found for this signature in database
GPG Key ID: 9D7D3C6BFF600C6A
1 changed files with 3 additions and 3 deletions

View File

@ -63,8 +63,9 @@ func (d *Daemon) updateNodeinfo(iface string, resp *data.ResponseData) {
if iface != "" {
resp.Nodeinfo.Network.Addresses = getAddresses(iface)
} else {
resp.Nodeinfo.Network.Addresses = []string{}
}
resp.Nodeinfo.Network.Mesh = make(map[string]*data.NetworkInterface)
for _, bface := range d.Batman {
@ -100,9 +101,8 @@ func (d *Daemon) updateNodeinfo(iface string, resp *data.ResponseData) {
}
if sbu.EntryData["up"].(bool) {
addr := sbu.EntryData["ipv6"].(string)
resp.Nodeinfo.Network.Addresses = append(resp.Nodeinfo.Network.Addresses, addr)
meshBabel.Interfaces.Tunnel = append(meshBabel.Interfaces.Tunnel, addr)
resp.Nodeinfo.Network.Addresses = append(resp.Nodeinfo.Network.Addresses, addr)
}
return nil
})