fix(clients): pin mDNS discovery to IPv4 on every client
Host machines' OS mDNS responders answer AAAA for hostname.local even though the punktfunk stack binds IPv4 sockets exclusively, so a v6-resolved address rendered a host card whose connect always failed. Apple's Network.framework prefers IPv6 (RFC 6724) — force the resolve connection to v4; pf-client-core (Linux/Windows/Deck shells) now picks get_addresses_v4() instead of an arbitrary first address. Android already did exactly this, for the same reason. Lift all three when the stack actually speaks IPv6 (per-family shard sizing is the gating item — the IPv6 header costs 20 bytes of the MTU budget shard_payload is maximal against). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,14 @@ pub fn browse() -> async_channel::Receiver<DiscoveryEvent> {
|
||||
ServiceEvent::ServiceResolved(info) => {
|
||||
let props = info.get_properties();
|
||||
let val = |k: &str| props.get_property_val_str(k).unwrap_or("").to_string();
|
||||
let Some(addr) = info.get_addresses().iter().next().map(|a| a.to_string())
|
||||
// IPv4 only, on purpose (same policy as the Android client): the core
|
||||
// dials `format!("{host}:{port}").parse::<SocketAddr>()` over IPv4-bound
|
||||
// sockets, so a v6 pick from this unordered address set (the host's OS
|
||||
// responder often answers AAAA for its hostname) would render a host card
|
||||
// that fails on every click. A v6-only advert is dropped — the honest
|
||||
// "not found" — until the stack actually speaks IPv6.
|
||||
let Some(addr) =
|
||||
info.get_addresses_v4().iter().next().map(|a| a.to_string())
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user