Skip to main content

Module udp_peers

Module udp_peers 

Source
Expand description

Desktop-to-desktop discovery that does not depend on mDNS (docs/specs/SPEC_LAN_FIREWALL_SETUP_2026_10_01.md §4.7 item 5, docs/specs/SPEC_LAN_UDP_PEER_DISCOVERY_2026_10_02.md).

mDNS can fail for reasons nothing on our side can fix: another program holds UDP 5353 (Area54, 2026-10-01: Chrome, then the DNS Client service), a guest network filters multicast, an interface never gets a socket. The UDP probe responder on 47891 only ever served mobile clients, so two desktops had one route to each other and no second.

Each instance binds one UDP port ([DESKTOP_DISCOVERY_PORT]) while LAN is on and, from that same socket:

  • sends the existing probe to the limited broadcast address and to each interface’s directed broadcast every [PROBE_INTERVAL];
  • answers a probe from a private-range source with the identity payload the 47891 responder sends (probe_response_json), without its siblings;
  • reads identity payloads that come back and records the sender as a peer.

Probing and answering share one socket on purpose: a peer’s reply goes to the probe’s source port, so it lands on a port the firewall rule names rather than on an ephemeral one.

Trust is the same as mDNS. A reply is network-claimed and unauthenticated, exactly like a TXT record; what it gains an attacker is a place in the peer table, not an identity. Jekt signing and LAN key pinning are untouched. The limits below (private-range source, field sizes, port floor, a peer cap) are the same defence in depth the mDNS path has.

Like the 47891 responder this socket does not set SO_REUSEADDR, so only the first instance on a host holds it. A second instance (a task dev build next to an installed one) quietly does without; hosts with one install are the case this exists for.