5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-23 02:55:39 +00:00

Fix build

This commit is contained in:
Neil Alexander 2020-07-06 14:21:28 +01:00
parent a4a346c498
commit d9fd68f18c
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -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
}