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:   [Bug 282251] java/openjdk22: IPv6 / INET6 is broken
Message-ID:  <bug-282251-8522@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D282251

            Bug ID: 282251
           Summary: java/openjdk22: IPv6 / INET6 is broken
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: java@FreeBSD.org
          Reporter: freebsd.68fba@nospam.spacesurfer.com
             Flags: maintainer-feedback?(java@FreeBSD.org)
          Assignee: java@FreeBSD.org

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();
}

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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