generalize upstream re-detection into network change watcher
Always detect network changes (LAN IP, upstream, peers) regardless of upstream config. LAN IP is now tracked in ServerCtx and updated every 30s — multicast announcements use the current IP instead of the startup IP. Upstream re-detection still only runs when auto-detected. Peer flush triggers on any network change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -33,8 +33,9 @@ pub struct ServerCtx {
|
||||
pub lan_peers: Mutex<PeerStore>,
|
||||
pub forwarding_rules: Vec<ForwardingRule>,
|
||||
pub upstream: Mutex<SocketAddr>,
|
||||
pub upstream_auto: bool, // true = auto-detected, false = explicitly configured
|
||||
pub upstream_auto: bool,
|
||||
pub upstream_port: u16,
|
||||
pub lan_ip: Mutex<std::net::Ipv4Addr>,
|
||||
pub timeout: Duration,
|
||||
pub proxy_tld: String,
|
||||
pub proxy_tld_suffix: String, // pre-computed ".{tld}" to avoid per-query allocation
|
||||
|
||||
Reference in New Issue
Block a user