From a2ec45e0254cd38c10406bf7476f8878d8366473 Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Sun, 19 May 2019 00:51:42 +0200 Subject: [PATCH] fix dupplicates addreses on babel --- respond/daemon/nodeinfo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/respond/daemon/nodeinfo.go b/respond/daemon/nodeinfo.go index f383aca..6c3a5f9 100644 --- a/respond/daemon/nodeinfo.go +++ b/respond/daemon/nodeinfo.go @@ -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 })