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 #2137 Socket.getifaddrs returns incorrect interface list... #2287
Conversation
added tests for Ifaddr and Addrinfo Socket.getifaddrs creates a packet interface for each IP interface Ifaddr and Addrinfo methods behave more like MRI 2.2.0 Need constant AF_PACKET (17) added to .h files Need to generate packet interface for interfaces with no IP address (platform dependent?)
Tests pass on my system (linux x86_64).
In the meantime, commit 7be572e adds Addrinfo and Ifaddr tests to jruby.index, maybe those test results will shed some light. |
Nope, no luck there. Tests in Addrinfo and Ifaddr call Socket.getifaddrs to generate objects to test. It fails in the same way without a Java stacktrace. All these tests pass locally for me under various combinations of network interface configurations. Is there any way to get at that trace to see what's different in Travis CI ? |
@iqeo That NPE would be easy to investigate if we had access to travis. Thankfully, we can do that. If you email the Travis support email, they can set up an ssh-able instance for you for 24 hours. That should make it easy to reproduce. Alternatively, you could set up a VM with the same releases of OS and JVM. Thanks for your help on this! |
Deal with null from getHardwareInterface() Tests permit multiple ipv4 loopbacks
Removed trivial test for Ifaddr.ifindex range, passes in debug VM, fails in build job
All set now. Access to the Travis VM was key to seeing .getHardwareAddress() returned null for their point-to-point interfaces. And a quirky difference with Ifaddr.ifindex between the VM and build job was failing a test in the build job. |
Great homework on this one, thank you. I'll merge locally to confirm it and then push if it's good. |
Fix #2137 Socket.getifaddrs returns incorrect interface list...
Socket.getifaddrs creates a single packet interface for each IP interface.
Ifaddr and Addrinfo methods behave more like MRI 2.2.0.
Added tests for Ifaddr and Addrinfo.
Need constant AF_PACKET (17) added to .h files - was unable to figure out where to change FFI platform specific files to affect build.
Need to generate packet interface for interfaces with no IP address (platform dependent?).