fix DNS failure on network change with upstream re-detection

Upstream DNS was resolved once at startup and never updated. Switching
Wi-Fi networks made all queries fail until restart.

Now spawns a background task (every 30s) that re-runs system DNS
discovery and swaps the upstream atomically if it changed. Also flushes
stale LAN peers from the old network on change.

Only activates when upstream is auto-detected (not explicitly configured).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Razvan Dimescu
2026-03-22 09:31:49 +02:00
parent 32bff69113
commit f01b2418cd
4 changed files with 54 additions and 4 deletions

View File

@@ -57,6 +57,10 @@ impl PeerStore {
})
.collect()
}
pub fn clear(&mut self) {
self.peers.clear();
}
}
// --- Multicast ---