From 7ea29baacf0b013ee1f76bb8c7c9b5ff35958c3c Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 25 Aug 2026 13:59:52 +0800 Subject: [PATCH] webrtc: stop gathering link-local IPv6 host candidates fe80::/10 can only be bound together with a scope id, which the gathered address list drops before it reaches the bind, so every link-local address yields nothing but a failed bind and a warning line - seven of them per session on a macOS host. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_019UzcMTdYTEv2QbMHcTSUy3 --- src/webrtc.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/webrtc.rs b/src/webrtc.rs index 83ea5799f..0de1f3501 100644 --- a/src/webrtc.rs +++ b/src/webrtc.rs @@ -566,6 +566,13 @@ impl WebRTCStream { let mut s = SettingEngine::default(); s.detach_data_channels(); s.set_ice_multicast_dns_mode(MulticastDnsMode::Disabled); + // fe80::/10 can only be bound together with a scope id, which `IpAddr` cannot carry, so + // gathering one never yields a candidate - only a failed bind and a warning per address. + // Spelled out because `is_unicast_link_local` is not stable on our MSRV. + s.set_ip_filter(Box::new(|ip: IpAddr| match ip { + IpAddr::V6(v6) => v6.segments()[0] & 0xffc0 != 0xfe80, + IpAddr::V4(_) => true, + })); // Create the API object let api = APIBuilder::new().with_setting_engine(s).build();