Skip to content

Commit

Permalink
IPV6_RECVPKTINFO is the correct option to receive IPV6_PKTINFO
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Nov 21, 2024
1 parent 150911e commit b786ce9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions FlyingSocks/Sources/Socket+Android.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ extension Socket {
static let ipproto_ipv6 = Int32(IPPROTO_IPV6)
static let ip_pktinfo = Int32(IP_PKTINFO)
static let ipv6_pktinfo = Int32(IPV6_PKTINFO)
static let ipv6_recvpktinfo = Int32(IPV6_RECVPKTINFO)

static func makeAddressINET(port: UInt16) -> Android.sockaddr_in {
Android.sockaddr_in(
Expand Down
1 change: 1 addition & 0 deletions FlyingSocks/Sources/Socket+Darwin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extension Socket {
static let ipproto_ipv6 = Int32(IPPROTO_IPV6)
static let ip_pktinfo = Int32(IP_PKTINFO)
static let ipv6_pktinfo = Int32(50) // __APPLE_USE_RFC_2292
static let ipv6_recvpktinfo = Int32(61) // __APPLE_USE_RFC_2292

static func makeAddressINET(port: UInt16) -> Darwin.sockaddr_in {
Darwin.sockaddr_in(
Expand Down
1 change: 1 addition & 0 deletions FlyingSocks/Sources/Socket+Glibc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extension Socket {
static let ipproto_ipv6 = Int32(IPPROTO_IPV6)
static let ip_pktinfo = Int32(IP_PKTINFO)
static let ipv6_pktinfo = Int32(IPV6_PKTINFO)
static let ipv6_recvpktinfo = Int32(IPV6_RECVPKTINFO)

static func makeAddressINET(port: UInt16) -> Glibc.sockaddr_in {
Glibc.sockaddr_in(
Expand Down
1 change: 1 addition & 0 deletions FlyingSocks/Sources/Socket+Musl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extension Socket {
static let ipproto_ipv6 = Int32(IPPROTO_IPV6)
static let ip_pktinfo = Int32(IP_PKTINFO)
static let ipv6_pktinfo = Int32(IPV6_PKTINFO)
static let ipv6_recvpktinfo = Int32(IPV6_RECVPKTINFO)

static func makeAddressINET(port: UInt16) -> Musl.sockaddr_in {
Musl.sockaddr_in(
Expand Down
1 change: 1 addition & 0 deletions FlyingSocks/Sources/Socket+WinSock2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ extension Socket {
static let ipproto_ipv6 = Int32(IPPROTO_IPV6)
static let ip_pktinfo = Int32(IP_PKTINFO)
static let ipv6_pktinfo = Int32(IPV6_PKTINFO)
static let ipv6_recvpktinfo = Int32(IPV6_RECVPKTINFO)

static func makeAddressINET(port: UInt16) -> WinSDK.sockaddr_in {
WinSDK.sockaddr_in(
Expand Down
2 changes: 1 addition & 1 deletion FlyingSocks/Sources/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public struct Socket: Sendable, Hashable {
name = Self.ip_pktinfo
case AF_INET6:
level = Socket.ipproto_ipv6
name = Self.ipv6_pktinfo
name = Self.ipv6_recvpktinfo
default:
return
}
Expand Down

0 comments on commit b786ce9

Please sign in to comment.