Skip to content

Commit

Permalink
Merge pull request #1 from needle-tail/main
Browse files Browse the repository at this point in the history
Added if check to determine swift version and OS in channelRead on St…
  • Loading branch information
Joannis authored Jan 22, 2022
2 parents 41cc48e + fdeab9c commit afbfa0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.vscode/
6 changes: 5 additions & 1 deletion Sources/Dribble/StunInboundHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit afbfa0a

Please sign in to comment.