mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-08-27 04:37:35 +00:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019UzcMTdYTEv2QbMHcTSUy3
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user