From e09ca6a089cbb138e7743931f34fe766bf062bd6 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 6 Jul 2020 14:21:28 +0100 Subject: [PATCH] Fix build --- src/yggdrasil/api.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/yggdrasil/api.go b/src/yggdrasil/api.go index be905cbc..4232f3c4 100644 --- a/src/yggdrasil/api.go +++ b/src/yggdrasil/api.go @@ -485,12 +485,14 @@ func (c *Core) RemovePeer(addr string, sintf string) error { } } - ports := c.peers.ports.Load().(map[switchPort]*peer) - for p, peer := range ports { - if addr == peer.intf.name { - c.peers.removePeer(p) + c.peers.Act(nil, func() { + ports := c.peers.ports + for _, peer := range ports { + if addr == peer.intf.name() { + c.peers._removePeer(peer) + } } - } + }) return nil }