Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jul 2026 11:15:27 +0200
From:      Harald Eilertsen <haraldei@anduin.net>
To:        java@freebsd.org
Cc:        java@freebsd.org
Subject:   Re: [Bug 282251] java/openjdk22: IPv6 / INET6 is broken
Message-ID:  <akzB_Dy_xJgbz4Im@samhain.localdomain>
In-Reply-To: <bug-282251-8522-tUq0r5jKOV@https.bugs.freebsd.org/bugzilla/>
References:  <bug-282251-8522@https.bugs.freebsd.org/bugzilla/> <bug-282251-8522-tUq0r5jKOV@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

On Mon, Jul 06, 2026 at 09:45:32PM +0000, bugzilla-noreply@freebsd.org wrote:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282251
>
> --- Comment #11 from Patrick Mackinlay <freebsd.68fba@nospam.spacesurfer.com> ---
> On openjdk25 (current stable java), the code at the top works whatever the
> net.inet6.ip6.v6only sysctl is set to.
> But, with -Djava.net.preferIPv4Stack=true the code fails with "Failed to
> connect to localhost with INET6"

That is the expected behaviour.

> I think it should work regardless of what you set the value to, it does in
> linux.

That's strange. I get identical results in both ArchLinux with OpenJDK
26 and on FreeBSD with OpenJDK 25, 26 and mainline. All of them
correctly refuses to bind to an IPv6 address if preferIPv4Stack is set.

>From the network bootup code in the JVM, this is clearly as intended
even though I agree the naming of the option makes it unclear that it
actually disables IPv6 support completely.

https://github.com/battleblow/jdk/blob/bsd-port/src/java.base/share/native/libnet/net_util.c#L84

Take care!
Harald


home | help

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