java defaults to IPv4 instead of IPv6

Originator:ron
Number:rdar://7100919 Date Originated:28-Jul-2009 09:01 PM
Status:Open Resolved:No
Product:Java Product Version:all
Classification:Other Bug Reproducible:Yes
 
Summary:
When operating in a dual stack (IPv4 and IPv6) environment, all network transactions normally prefer IPv6 over IPv4 if a DNS query returns both an AAAA and an A record for a given host name or URL.  However, in this environment, java apps launched from Safari and Firefox prefer IPv4 instead of IPv6, even if the server and web site are IPv6 enabled.  If you look in the release notes for java 1.4, you can see that this is intentional (although incorrect, in my opinion).  But, you are supposed to be able to set the java preference java.net.preferIPv6Addresses=true to change the behavior and prefer IPv6 instead.  Setting the preference has no effect.

Steps to Reproduce:
1.  Have a dual stack web site where it is registered in DNS with both AAAA and A records for the name.
2.  Have a java applet on that web site that also connects to that web server.
3.  Connect your MAC to an IPv6-enabled network
4.  Set java preference "-Djava.net.preferIPv6Addresses=true"
5.  From Safari, open the web site and verify that you are connecting with IPv6.
6.  Launch the java applet on the web site.
7.  Observe whether the java applet connects to the web site using IPv4 or IPv6

Expected Results:
java should connect using IPv6, because of the preference setting.

Actual Results:
java connects using IPv4.

Regression:
Based on experimentation, we learned that if you remove the "A" record from DNS, so that you only have an "AAAA" record (IPv6 address), then java will connect using IPv6.  
We also experimented with a Windows XP system and there the java preference setting has the desired effect.

Notes:
From the java console, we could see that the java preference was getting set correctly.  That was when using Safari.  When using Firefox, the java preference does not get set as expected.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!