-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
MacOS IPv6 UDP - No Route to Host (Works on Linux and Windows) #11563
Comments
cc @vietj |
Is there anymore information on this? Any more testing I can help with? I noticed it was pushed to the next milestone. It's really blocking us from using Netty/Vert.x for UDP, since we want to support Windows, Linux and MacOS. |
Update: If I run my code using JDK17 with both the Sender and Receiver on the same host, things work fine with UDP IP6. However, if I switch back to JDK11 try both the Sender and Receiver on the same host, I get the error as before. Trying the Sender on a linux machine and my Receiver (Device Mode) on my Mac, still fails under both JDKs when trying to respond back to the sender UDP address and port. |
Any further ideas on this? Am I the only one using VertX UDP in this manner? Is there any further testing you'd like me to try? |
I turned on Netty Debugging and this is the output when it read a packet and tried to respond back to the destination address. I looks like it might be dropping the SCOPE_ID? the %15 when trying to send out? I notice the ID on the other addresses but not on the outgoing attempt... Just guessing at this point.
|
@normanmaurer I found this Netty issue (#267) which discusses the stripping of SCOPE_ID and how there was some sort of "hack" that was removed because it broke MacOS. I believe that is exactly what I'm running into when trying to send UDP over a link-local address, the SCOPED_ID is being stripped somehow. I see the address properly in the logs but when it gets to NioDatagramChannel.doWriteMessage() the scope id has been set to 0..when in my case it should be 15. I see where the address is being stripped in DatagramSocketImpl.java:
This line: " The resolver "AddressResolver" just seems to create an "Unresolved Address" and then is passed to a resolver in my case appears to be "DnsResolverProvider" which I think is the issue and the stripping of the SCOPE_ID is happening. In my Netty Log output I see these lines:
and then later on:
After the call to "resolver.resolve()" the scope is gone..
By the time this code from IpAddressUtil gets called to find the scoped address it's too late because the original scope has been stripped and the comparison from the incoming address to the ones found on the NetworkInterface fail because of the missing scope, causing an empty list to be returned.
I ran the same filter code above using the AccessController in a standalone program to read all my network cards and it found all the scoped addresses just fine. So, if I had to guess, that is where the problem lies. Something in the RESOLVER is stripping out the SCOPE_ID |
@tmulle so you say this only happens on JDK11 on macOS ? |
@normanmaurer JDK11 and JDK17 on both Intel and ARM based JDKs. I originally noticed this issue on my Intel MacBook Pro with JDK11 and JDK17. I have moved to a M1 Mac and the same error is occurring with both JDKs (native..non Rosetta) |
but only on macOs ? |
yes..Windows and Linux seem fine last I tried. It's been a while, I will try on my Fedora linux system at work in a little while |
@tmulle ok perfect... let me dig in |
@normanmaurer Perfect thanks! Hope you can find something.. I wrote a Network interface utility to print out all the information about the cards found on a system. Shows things like Scope ID, etc. Feel free to use it: https://github.com/tmulle/NetworkInformationUtility.git |
Motivation: Due a bug we did strip the scopeId of the ipv6 address string when using the DnsNameResolver. This could later then result to things like "No Route to host" exceptions. Modifications: - Add new method to NetUtil which will create the InetAddress for an string that contains an ip while still preserve the scopeId. - Use this new method - Add unit tests. Result: Fixes #11563
@normanmaurer Yeah, unfortunately, I don't have two bare metal machines (Linux -> Linux) or (Windows->Windows) to run my test code on. It works fine when I use Linux -> Windows VM. I found this discussion about % in Ipv6 addresses.. packed full of information. https://superuser.com/questions/99746/why-is-there-a-percent-sign-in-the-ipv6-address |
@normanmaurer FYI - I just tried (MacOS -> Linux VM) and the responding from MacOS back to Linux failed with the 'No Route to Host' so it's definitely something on the MacOS side. |
Motivation: Due a bug we did strip the scopeId of the ipv6 address string when using the DnsNameResolver. This could later then result to things like "No Route to host" exceptions. Modifications: - Add new method to NetUtil which will create the InetAddress for an string that contains an ip while still preserve the scopeId. - Use this new method - Add unit tests. Result: Fixes #11563
Motivation: Due a bug we did strip the scopeId of the ipv6 address string when using the DnsNameResolver. This could later then result to things like "No Route to host" exceptions. Modifications: - Add new method to NetUtil which will create the InetAddress for an string that contains an ip while still preserve the scopeId. - Use this new method - Add unit tests. Result: Fixes #11563
This should be fixed by the next netty release (4.1.74.Final) |
@normanmaurer Great! is there a build I can try out before the official release? I tried to build your 'dont_strip_scope_id' branch but I kept getting errors about the native transport and OpenSSL tests failed. When do you anticipate the next official release? |
Motivation: Due a bug we did strip the scopeId of the ipv6 address string when using the DnsNameResolver. This could later then result to things like "No Route to host" exceptions. Modifications: - Add new method to NetUtil which will create the InetAddress for an string that contains an ip while still preserve the scopeId. - Use this new method - Add unit tests. Result: Fixes netty#11563
@normanmaurer I just verified that this now works in 4.1.74.Final. I had to override the Vert.x Netty versions it is pulling in since they are still using 4.1.72 officially. But once they update to 4.1.74 things are good. Thanks to everyone who helped! |
thanks for this contribution @tmulle |
and thanks everyone who helped :-) |
Motivation: Due a bug we did strip the scopeId of the ipv6 address string when using the DnsNameResolver. This could later then result to things like "No Route to host" exceptions. Modifications: - Add new method to NetUtil which will create the InetAddress for an string that contains an ip while still preserve the scopeId. - Use this new method - Add unit tests. Result: Fixes netty#11563
Hi,
I initially created this ticket over on Vert.x, but thought I'd also post it here just in case it is a Netty issue.
I'm sorry for cross posting, since the stack trace shows both Netty and Vert.x I thought I'd share it in both places
in case it turns out to be both frameworks needing a fix.
Please feel free to move or close the issue if this isn't the correct place.
This bug is preventing me from converting our existing legacy Java networking code to using either Netty or Vert.x for UDP handling.
Thanks!
Steps to reproduce
This is the original bug I reported: eclipse-vertx/vert.x#4059
Minimal yet complete reproducer code (or URL to code)
Here is the repo where I have a pretty comprehensive test clients showing both Netty/Vertx and raw Java networking
https://github.com/tmulle/VertxNettyUDP6Tester
The text was updated successfully, but these errors were encountered: