From d9fd68f18cd4214004e969b546c8f26e915f8934 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 13f4cb10..c800cb0d 100644 --- a/src/yggdrasil/api.go +++ b/src/yggdrasil/api.go @@ -465,12 +465,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 }