java/165957: Enabling IPv6 in port java/jdk16 disables IPv4

Bob Bishop rb at gid.co.uk
Mon Mar 12 15:03:36 UTC 2012


Hi,

On 12 Mar 2012, at 01:46, Merlin wrote:

> 
>> Number:         165957
>> Category:       java
>> Synopsis:       Enabling IPv6 in port java/jdk16  disables IPv4
>> Confidential:   no
>> Severity:       serious
>> Priority:       low
>> Responsible:    freebsd-java
>> State:          open
>> Quarter:        
>> Keywords:       
>> Date-Required:
>> Class:          sw-bug
>> Submitter-Id:   current-users
>> Arrival-Date:   Mon Mar 12 01:50:10 UTC 2012
>> Closed-Date:
>> Last-Modified:
>> Originator:     Merlin
>> Release:        9.0-RELEASE
>> Organization:
> merlinsbox.net
>> Environment:
> FreeBSD machine.merlinsbox.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>> Description:
> java/jdk16 with IPV6 enabled in configuration caused ipv4 to be disabled.  Many applications which used the network all failed, unless dealing with ipv6 addresses.  A test case of creating a connected socket and outputting the exception showed an invalid parameter was being passed to a socket call, which lead to the discovery that only ipv4 addresses were affected by this issue.

Probably java with IPv6 assumes IPv4 mapped addressing is in use (net.inet6.ip6.v6only = 0), which is likely to break other applications. 

>> How-To-Repeat:
> Built and installed java/jdk16 from ports inside a jail on a build machine, with IPV6, WEB, POLICY, TZUPDATE, and JAIL selected in the configuration.  Installed on two machines with the same effect (no ipv4).
> 
> Namely, the following test program and methodology was used to diagnose the problem:
> 
> Started netcat listeners like so:
> $ nc -lk 127.0.0.1 2000
> $ nc -lk ::1 2000
> 
> //
> // test.java
> // built with javac test.java
> // ran with java test
> //
> 
> import java.net.*;
> 
> public class test {
>    public static void main(String argv[])
>    {
> 	try {
>            // This line was modified to be 127.0.0.1 to test ipv4
> 	    new Socket("::1", 2000);
> 	    System.out.println("Success");
> 	} catch (Exception e) {
> 	    e.printStackTrace();
> 	}
>    }
> }
> 
> //
> // end test.java
> //
>> Fix:
> Rebuilding the port without IPV6 has fixed IPV4, but now I cannot of course use IPV6.  Thankfully, I didn't really NEED it (not like I NEED IPv4 anyway :P).
> 
>> Release-Note:
>> Audit-Trail:
>> Unformatted:
> _______________________________________________
> freebsd-java at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe at freebsd.org"
> 


--
Bob Bishop          +44 (0)118 940 1243
rb at gid.co.uk    fax +44 (0)118 940 1295
             mobile +44 (0)783 626 4518







More information about the freebsd-java mailing list