fix nodes disappearing
This commit is contained in:
parent
4d0424e465
commit
43eced6e9a
1 changed files with 6 additions and 0 deletions
|
@ -498,6 +498,12 @@ impl State {
|
||||||
|
|
||||||
fn read_wg_peers(&mut self, daemon: &Daemon) -> Result<()> {
|
fn read_wg_peers(&mut self, daemon: &Daemon) -> Result<()> {
|
||||||
let (_, _, wg_peers) = wg_dump(&daemon.config)?;
|
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 {
|
for (pk, endpoint, last_seen) in wg_peers {
|
||||||
match self.peers.get_mut(&pk) {
|
match self.peers.get_mut(&pk) {
|
||||||
Some(i) => {
|
Some(i) => {
|
||||||
|
|
Loading…
Reference in a new issue