From nobody Tue Jul 07 09:15:27 2026 X-Original-To: java@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gvbDY5q8dz6lCN5 for ; Tue, 07 Jul 2026 09:15:41 +0000 (UTC) (envelope-from haraldei@anduin.net) Received: from mail.anduin.net (mail.anduin.net [185.42.170.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4gvbDV56ldz4PHb for ; Tue, 07 Jul 2026 09:15:38 +0000 (UTC) (envelope-from haraldei@anduin.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=anduin.net header.s=dkim2021 header.b=XVKEXY5o; spf=pass (mx1.freebsd.org: domain of haraldei@anduin.net designates 185.42.170.45 as permitted sender) smtp.mailfrom=haraldei@anduin.net; dmarc=pass (policy=reject) header.from=anduin.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anduin.net; s=dkim2021; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dfVuvivpFP+QeOeLgCna9RX1RW0Zp+A8xwm6pmVnv+4=; t=1783415738; x=1784279738; b=XVKEXY5oi5i9pMoy1fLraqM3YBkjQRGpSQCIuXO8o/QVZgwAfQH5+g/IG2DwmiLCs1DC07r3/wD /Xh8Y3GG/fX4hQs3O8MBE+bdLAYDg0evmcsBVcDFeYkbbRw1EFKIieft+0fjAEmHf8pHk6/YIahJz H/8gYZbuIvXge3NXIl84589/NGMp670Mp1RSMEVcyGzPHYfUpARUf5Xdu31vkuOqohKZxNtUkHtGD yW06787w0ZGx4+sKqf7Q8sCPcYTi75XQYj4l64UoyKTWgqpZT+cTwQjszEnBx0+KXrbnJhh4W467r smFxYoWpPML4nF/BTvNj+mRmkgI9Hqvvhx3g==; Received: by mail.anduin.net with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.99.3 (FreeBSD)) (envelope-from ) id 1wh1to-000000009Mg-18IE; Tue, 07 Jul 2026 09:15:30 +0000 Date: Tue, 7 Jul 2026 11:15:27 +0200 From: Harald Eilertsen To: java@freebsd.org Cc: java@freebsd.org Subject: Re: [Bug 282251] java/openjdk22: IPv6 / INET6 is broken Message-ID: References: List-Id: Porting Java to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-java List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-java@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SA-Authenticated: Yes X-Spam-Score: -1.9 X-Spam-Level: - X-Spam-Report: host: mail.modirum.com | contact: hostmaster@modirum.com | scores: BAYES_00=-1.9,NO_RELAYS=-0.001 | autolearn=no autolearn_force=no, score=0 X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[anduin.net,reject]; R_DKIM_ALLOW(-0.20)[anduin.net:s=dkim2021]; R_SPF_ALLOW(-0.20)[+ip4:185.42.170.45/32]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:62248, ipnet:185.42.170.0/24, country:EE]; RCVD_TLS_ALL(0.00)[]; FREEFALL_USER(0.00)[haraldei]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[java@freebsd.org]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[anduin.net:+] X-Rspamd-Queue-Id: 4gvbDV56ldz4PHb X-Spamd-Bar: --- 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 --- > 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