Skip to content

Fix IPv6 socket addresses on Native - #3777

Open
lavrov wants to merge 1 commit into
typelevel:mainfrom
lavrov:fix/native-ipv6-sockaddr
Open

lavrov wants to merge 1 commit into
typelevel:mainfrom
lavrov:fix/native-ipv6-sockaddr

Conversation

@lavrov

@lavrov lavrov commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

toSockaddrIn6 never copied the address bytes (while (i < 0)), so every IPv6 address was passed to the kernel as ::. Also replace fs2's own sockaddr bindings with Scala Native's posix.netinet.in/sys.un, which handle the BSD sa_len/sa_family layout. Without that, IPv6 bind fails on macOS with EAFNOSUPPORT.

`toSockaddrIn6` never copied the address bytes (`while (i < 0)`), so every
IPv6 address was passed to the kernel as `::`. Also replace fs2's own
sockaddr bindings with Scala Native's `posix.netinet.in`/`sys.un`, which
handle the BSD `sa_len`/`sa_family` layout. Without that, IPv6 bind fails
on macOS with EAFNOSUPPORT.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant