mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 05:46:03 +00:00
Avoid link local IPv6 addresses
This commit is contained in:
1 parent
fd29254e38
commit
238769656a
2 files changed
+7
-2
No files matched your search
@@ -17,6 +17,7 @@ struct NearbyResolvedBonjourEndpoint {
|
|||||||
let interface: NWInterface?
|
let interface: NWInterface?
|
||||||
let description: String
|
let description: String
|
||||||
let isIPv4: Bool
|
let isIPv4: Bool
|
||||||
|
let isLinkLocal: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -126,6 +127,9 @@ final class NearbyBonjourServiceResolver: NSObject, NetServiceDelegate {
|
|||||||
if lhs.isIPv4 != rhs.isIPv4 {
|
if lhs.isIPv4 != rhs.isIPv4 {
|
||||||
return lhs.isIPv4
|
return lhs.isIPv4
|
||||||
}
|
}
|
||||||
|
if lhs.isLinkLocal != rhs.isLinkLocal {
|
||||||
|
return !lhs.isLinkLocal
|
||||||
|
}
|
||||||
return lhs.description < rhs.description
|
return lhs.description < rhs.description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,7 +189,8 @@ final class NearbyBonjourServiceResolver: NSObject, NetServiceDelegate {
|
|||||||
port: portRawValue,
|
port: portRawValue,
|
||||||
interface: isIPv6LinkLocal ? interface : nil,
|
interface: isIPv6LinkLocal ? interface : nil,
|
||||||
description: description,
|
description: description,
|
||||||
isIPv4: addressFamily == AF_INET
|
isIPv4: addressFamily == AF_INET,
|
||||||
|
isLinkLocal: isIPv6LinkLocal
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
"location" : "https://github.com/siteline/swiftui-introspect",
|
"location" : "https://github.com/siteline/swiftui-introspect",
|
||||||
"state" : {
|
"state" : {
|
||||||
"branch" : "main",
|
"branch" : "main",
|
||||||
"revision" : "b789ee16f0000b35860a46a0bebca7074546d0d0"
|
"revision" : "c3db5696c625f8571f5f26fb292568db517374cc"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user