From 238769656ace623c81d15f9f1eff1b44e7abff92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= <49094811+leonboe1@users.noreply.github.com> Date: Wed, 20 May 2026 19:38:23 +0200 Subject: [PATCH] Avoid link local IPv6 addresses --- NearbyShare/Connection/NearbyBonjourServiceResolver.swift | 7 ++++++- .../xcshareddata/swiftpm/Package.resolved | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NearbyShare/Connection/NearbyBonjourServiceResolver.swift b/NearbyShare/Connection/NearbyBonjourServiceResolver.swift index 6e02020..33b54d2 100644 --- a/NearbyShare/Connection/NearbyBonjourServiceResolver.swift +++ b/NearbyShare/Connection/NearbyBonjourServiceResolver.swift @@ -17,6 +17,7 @@ struct NearbyResolvedBonjourEndpoint { let interface: NWInterface? let description: String let isIPv4: Bool + let isLinkLocal: Bool } @@ -126,6 +127,9 @@ final class NearbyBonjourServiceResolver: NSObject, NetServiceDelegate { if lhs.isIPv4 != rhs.isIPv4 { return lhs.isIPv4 } + if lhs.isLinkLocal != rhs.isLinkLocal { + return !lhs.isLinkLocal + } return lhs.description < rhs.description } } @@ -185,7 +189,8 @@ final class NearbyBonjourServiceResolver: NSObject, NetServiceDelegate { port: portRawValue, interface: isIPv6LinkLocal ? interface : nil, description: description, - isIPv4: addressFamily == AF_INET + isIPv4: addressFamily == AF_INET, + isLinkLocal: isIPv6LinkLocal ) } } diff --git a/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d1de184..716c72e 100644 --- a/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/QuickDrop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -124,7 +124,7 @@ "location" : "https://github.com/siteline/swiftui-introspect", "state" : { "branch" : "main", - "revision" : "b789ee16f0000b35860a46a0bebca7074546d0d0" + "revision" : "c3db5696c625f8571f5f26fb292568db517374cc" } }, {