Skip to main content

peer_staleness_window_secs

Function peer_staleness_window_secs 

Source
fn peer_staleness_window_secs(other_ttl_secs: u32) -> u64
Expand description

A peer is stale once last_seen exceeds ITS OWN advertised other_ttl — the standards-defined lifetime of the PTR/TXT records that make up an mDNS announcement — not one fixed cutoff shared by every peer regardless of how often it actually re-announces. Clamped between LAN_PEER_STALE_TIMEOUT_FLOOR_SECS (guards an implausibly small advertised TTL) and LAN_PEER_STALE_TIMEOUT_CEIL_SECS (guards an adversarially large one — other_ttl_secs is untrusted peer input).