aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-03-09 14:55:49 +0100
committerAlex Auvolat <alex@adnab.me>2023-03-09 14:55:55 +0100
commit43eced6e9aa5935b4553251604207f72bf0214c1 (patch)
tree594b0f8442e14d19788b5b5c0c282feeec1c979f /src
parent4d0424e4654592ef81b72f60f4aa4878165fc53b (diff)
downloadwgautomesh-43eced6e9aa5935b4553251604207f72bf0214c1.tar.gz
wgautomesh-43eced6e9aa5935b4553251604207f72bf0214c1.zip
fix nodes disappearing
Diffstat (limited to 'src')
-rw-r--r--src/main.rs6
1 files changed, 6 insertions, 0 deletions
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) => {