Bug 165957

Summary: Enabling IPv6 in port java/jdk16 disables IPv4
Product: Ports & Packages Reporter: merlin
Component: Individual Port(s)Assignee: Greg Lewis <glewis>
Status: Closed Overcome By Events    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description merlin 2012-03-12 01:50:10 UTC
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.

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).
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
//
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-03-12 02:00:31 UTC
Responsible Changed
From-To: freebsd-java->glewis

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Bob Bishop 2012-03-12 14:59:28 UTC
Probably java with IPv6 assumes IPv4 mapped addressing is in use =
(net.inet6.ip6.v6only =3D 0), which is likely to break other =
applications.=20

--
Bob Bishop          +44 (0)118 940 1243
rb@gid.co.uk    fax +44 (0)118 940 1295
             mobile +44 (0)783 626 4518
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2014-03-23 22:45:47 UTC
State Changed
From-To: open->feedback

To submitter: since this PR was submitted, jdk16 has been retired. 
Should I close this PR as no longer relevant?
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2014-11-23 04:45:28 UTC
Feedback timeout (> 6 months).