From 43eced6e9aa5935b4553251604207f72bf0214c1 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 9 Mar 2023 14:55:49 +0100 Subject: [PATCH] fix nodes disappearing --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index f951f94..7b95d4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -498,6 +498,12 @@ impl State { fn read_wg_peers(&mut self, daemon: &Daemon) -> Result<()> { let (_, _, wg_peers) = wg_dump(&daemon.config)?; + + // Clear old known endpoints if any + for (_, peer) in self.peers.iter_mut() { + peer.endpoint = None; + } + for (pk, endpoint, last_seen) in wg_peers { match self.peers.get_mut(&pk) { Some(i) => {