Hi Alan and Chris,
I have updated the webrev[1] according to your suggestions.
For the test case, I did two things:
1. add the @run main/othervm -Djava.net.preferIPv4Stack=true PingThis
2. Only when !preferIPv4Stack and hasIPv6(), ::0 will be added into the
address list.
I think it's enough for the test case, please review it.
I just have another concern, how we can configure the test env so this
test case can be run under root (may use sudo) privilege?
[1] http://cr.openjdk.java.net/~littlee/OJDK-217/webrev.04/
<http://cr.openjdk.java.net/%7Elittlee/OJDK-217/webrev.04/>
Thanks a lot!
On 05/03/2012 03:58 PM, Chris Hegarty wrote:
On 03/05/2012 08:51, Alan Bateman wrote:
On 03/05/2012 08:46, Chris Hegarty wrote:
On the test, it would be good to run with it with
-Djava.net.preferIPv4Stack=true too, but ::0 should not be reachable.
I guess the test should check if preferIPv4Stack=true and skip testing
with ::0. Or only add ::0 to addresses if !preferIPv4Stack?
Even if preferIPv4Stack is false then IPv6 may be disabled on the system
so I suspect it will need to use NetworkInterface to see if there are
IPv6 addresses on any of the interfaces. I think we have other tests
that need to do the same thing (as you can probably guess, my motive for
bringing this up during the review is to ensure that the test would be
reliable in such environments).
L43: hasIPv6()
http://hg.openjdk.java.net/jdk8/tl/jdk/file/531ebfd8eb65/test/java/net/MulticastSocket/SetOutgoingIf.java
-Chris.
-Alan
--
Best Regards,
Deven