diff --git a/.gitignore b/.gitignore index bb460e7..48b48c3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ xcuserdata/ DerivedData/ .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.vscode/ diff --git a/Sources/Dribble/StunInboundHandler.swift b/Sources/Dribble/StunInboundHandler.swift index 2087cf9..05f33ec 100644 --- a/Sources/Dribble/StunInboundHandler.swift +++ b/Sources/Dribble/StunInboundHandler.swift @@ -34,7 +34,11 @@ final class StunInboundHandler: ChannelInboundHandler, StunMessageSender { case (.v4(let lhs), .v4(let rhs)): return lhs.address.sin_addr.s_addr == rhs.address.sin_addr.s_addr case (.v6(let lhs), .v6(let rhs)): - return lhs.address.sin6_addr.__u6_addr.__u6_addr32 == rhs.address.sin6_addr.__u6_addr.__u6_addr32 + #if swift(>=5.5) && os(Linux) + return lhs.address.sin6_addr.__in6_u.__u6_addr32 == rhs.address.sin6_addr.__in6_u.__u6_addr32 + #else + return lhs.address.sin6_addr.__u6_addr.__u6_addr32 == rhs.address.sin6_addr.__u6_addr.__u6_addr32 + #endif case (.v4, _), (.v6, _), (.unixDomainSocket, _), (_, .v4), (_, .v6), (_, .unixDomainSocket): return false