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

javalib java.net does not handle IPv6 scope_id believably #3672

Closed
LeeTibbert opened this issue Jan 14, 2024 · 0 comments · Fixed by #3702
Closed

javalib java.net does not handle IPv6 scope_id believably #3672

LeeTibbert opened this issue Jan 14, 2024 · 0 comments · Fixed by #3702

Comments

@LeeTibbert
Copy link
Contributor

If a bug happens in très obscure code, does it still make a sound?

Perhaps the sound of a devo screaming in pain.

Pending PR #3666 removes a number of defects in java.net.

With obscuring shrubbery removed, I spent quite some time trying to convince
myself that the scope_id field in Inet6Address and InterfaceAddress instances returned by
NetworkInterface gets passed cleanly from Java-to-C and back again from C-to-Java.
That is, can a, say, Inet6Address obtained from using NetworkInterface to find a
link-local address be used to send using that link? If the prior sentence makes
no sense to you at all, you have lead a good life.

The answer so far is "NO". There appear to be several (probably single digit > 2) places
where the scope_id is not properly set. This does not affect users of IPv6 Global (i.e. normal, visible
to the entire Internet) addresses but it likely to make a particular class of user unhappy.
Besides, it throws SN network code maintainers off their feed.

PS: It is very difficult to exercise, discover, and/or test this case. Difficult beyond the scope of feasible
Continuous Integration tests. One must rely upon code analysis, luck, and manual testing.

   Still, there is one user on the SN Discord channel who has discussed using `NetworkInterface`.
   They are the kind of person who is likely to get hosed.  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant