Re: IPv6 in Java on FreeBSD

From: Harald Eilertsen <haraldei_at_anduin.net>
Date: Wed, 19 Feb 2025 13:25:50 UTC
Hi Bob,

On Wed, Feb 19, 2025 at 12:26:17PM +0000, Bob Bishop wrote:
> I would just point out that back in history Java used to want mapped
> IPv4 (net.inet6.ip6.v6only=0) if IPv6 was enabled; most people don’t
> want that which may be why IPv6 support hasn’t been enabled.

That's really useful feedback! And the observation is still correct.
Java will by default clear the IPV6_V6ONLY flag on sockets when IPv6 is
available and requested (the default.)

I've made a quick test, where I patch Java to leave the setting alone,
but otherwise leave IPv6 enabled. That will allow the sysctl setting to
decide whether to use dual-socket or only accept IPv6 connections on the
socket.

Personally I think that makes sense. I'll update the PR's accordingly.

Take care!
Harald