Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2024 15:38:12 +0000
From:      bugzilla-noreply@freebsd.org
To:        java@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 282251] java/openjdk22: IPv6 / INET6 is broken
Message-ID:  <bug-282251-8522-yWtPaSAVjA@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-282251-8522@https.bugs.freebsd.org/bugzilla/>
References:  <bug-282251-8522@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-java (Nobody)
<java@FreeBSD.org> for maintainer-feedback:
Bug 282251: java/openjdk22: IPv6 / INET6 is broken
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D282251



--- Description ---
In java/openjdk22 IPv6 is broken, in java/openjdk17 it was working. I did n=
ot
try any openjdk's in between.

To be more specific in openjdk17 started with default settings, INET6 doesn=
't
work. However with -Djava.net.preferIPv4Stack=3Dfalse INET, INET6 and unspe=
cified
protocols all work.

In openjdk22 started with default settings, INET6 doesn't work. With
-Djava.net.preferIPv4Stack=3Dfalse no internet protocols work.

These issues can be reproduced with the java code

// Test unspecified protocol
try {
	ServerSocket ss =3D new ServerSocket(0);
	Socket cs =3D new Socket(ss.getInetAddress(), ss.getLocalPort());
	OutputStream os =3D cs.getOutputStream();
	InputStream is =3D cs.getInputStream();
	Socket as =3D ss.accept();
	System.out.println("Connected " + cs + " to " + as);
	ss.close();
	cs.close();
	as.close();
} catch (IOException ex) {
	System.err.println("Failed to connect to localhost with unspecified
protocol");
	ex.printStackTrace();
}

// Test INET (IPv6)
try {
	InetAddress addr =3D InetAddress.getByName("127.0.0.1");
	ServerSocket ss =3D new ServerSocket(0, 1, addr);
	Socket cs =3D new Socket(ss.getInetAddress(), ss.getLocalPort());
	OutputStream os =3D cs.getOutputStream();
	InputStream is =3D cs.getInputStream();
	Socket as =3D ss.accept();
	System.out.println("Connected " + cs + " to " + as);
	ss.close();
	cs.close();
	as.close();
} catch (IOException ex) {
	System.err.println("Failed to connect to localhost with INET");
	ex.printStackTrace();
}

// Test INET6
try {
	InetAddress addr =3D InetAddress.getByName("::0");
	ServerSocket ss =3D new ServerSocket(0, 1, addr);
	Socket cs =3D new Socket(ss.getInetAddress(), ss.getLocalPort());
	OutputStream os =3D cs.getOutputStream();
	InputStream is =3D cs.getInputStream();
	Socket as =3D ss.accept();
	System.out.println("Connected " + cs + " to " + as);
	ss.close();
	cs.close();
	as.close();
} catch (IOException ex) {
	System.err.println("Failed to connect to localhost with INET6");
	ex.printStackTrace();
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-282251-8522-yWtPaSAVjA>