Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3672: Improve javalib java.net handling of NetworkInterface indices #3702

Merged

Conversation

LeeTibbert
Copy link
Contributor

Fix #3672

Most end users of java.net use IPv6 global addresses. This PR is for the few who use link-local addresses.

javalib java.net methods should now handle IPv6 sin6_scope_ids, known to Java as NetworkInterface indices
so that a connection using an IPv6 link-local (FE80::) address should be accepted on by a server yielding
an IPv6Address which can be used to connect back over the local link. That is, a round trip using
link-local addresses should work.

@LeeTibbert LeeTibbert marked this pull request as draft January 21, 2024 21:19
@LeeTibbert
Copy link
Contributor Author

I am marking this as WIP & Draft because I did some more private testing.

Looks like accept() on a link-local address is not working at least on macOS.

I have not tried it yet with a macOS client connecting to a Linux server.

@LeeTibbert
Copy link
Contributor Author

LeeTibbert commented Jan 23, 2024

I believe this PR is ready for review, in the fullness of time.

Whilst trying to increase my confidence in the changes of this PR, I discovered & reported
Issues #3705 and #3706.

When I hacked around those in my private sandbox, these changes allowed a send/receive "round trip"
over an IPv6 local link. Debug printouts of the addresses involved indicated that lPv6 link-local addresses,
with the expected NetworkInterface indices (sin6_scope_id) were being used.

I examined the build logs to see if this PR introduced any new errors. Did not see such.

@WojciechMazur WojciechMazur merged commit 834f6e3 into scala-native:main Jan 23, 2024
52 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

javalib java.net does not handle IPv6 scope_id believably
2 participants