Skip to content

Add support for SO_ORIGINAL_DST socket option in scala-native#3656

Merged
mpilquist merged 8 commits intotypelevel:mainfrom
rreckel:original_dest
Jan 29, 2026
Merged

Add support for SO_ORIGINAL_DST socket option in scala-native#3656
mpilquist merged 8 commits intotypelevel:mainfrom
rreckel:original_dest

Conversation

@rreckel
Copy link
Contributor

@rreckel rreckel commented Jan 9, 2026

No description provided.

@rreckel rreckel marked this pull request as ready for review January 9, 2026 10:23
)(_ == ENOPROTOOPT)
if (ret == ENOPROTOOPT) None
else {
val sockaddr = ptr.asInstanceOf[Ptr[sockaddr_storage]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use toSocketAddress here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I suppose that is a very good idea. I changed the PR.

I still suppose that the returned SocketAddress is an IP Address as this option only makes sense in a netfilter context....
What so you think? Is this assumption to unsafe? Are there other situations when the getsockopt would return a socket address?
Let me know, as returning a GenSocketAddress is also possible...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree on IpAddress only

@mpilquist mpilquist merged commit a3d5122 into typelevel:main Jan 29, 2026
16 checks passed
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.

2 participants