aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-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) => {