On Mon, 2017-02-20 at 17:16 -0500, Kurt Miller wrote:
> On Mon, 2017-02-20 at 13:13 -0500, Kurt Miller wrote:
> > 
> > On Thu, 2017-01-19 at 08:38 -0500, Nick wrote:
> > > 
> > > 
> > > On 2017/01/16 12:38, Stuart Henderson wrote:
> > > > 
> > > > 
> > > > 
> > > > I don't think Java's v6 support has been tested much on
> > > > OpenBSD,
> > > > in
> > > > general it's rather awkward because Java expects support for v6
> > > > sockets to work with mapped v4 addresses, which is not the case
> > > > on
> > > > OpenBSD.
> > > > 
> > > > IPv6_supported() in
> > > > jdk/src/solaris/native/java/net/net_util_md.c
> > > > has
> > > > a couple of checks to decide whether to use v6 or not; I
> > > > suspect
> > > > one
> > > > of these may be failing. Does this help at all?
> > > Thanks for the help. So what you sent me is a patch, correct? I
> > > put
> > > it
> > > in the jdk's patches folder and then recompiled everything
> > > (patch,
> > > package, install). However it's still not working.
> > > 
> > > When I look at the logs of the package phase I see that
> > > Inet4AddressImpl
> > > is compiled but there is not mention of Inet6AddressImpl. How can
> > > I
> > > debug this IPv6_supported function?
> > Sorry for the late reply. java's ipv6 has issues as it relies on
> > ipv4
> > to ipv6 address mapping. There is a 'with_ipv6' flavor which is
> > described in the package description as follows:
> > 
> >   with_ipv6
> >     Build the jdk/jre with ipv6 support. When the jdk/jre is built
> >     with this flavor, java will create only ipv6 sockets by
> > default.
> >     Since ipv4 to ipv6 address mapping is disabled on OpenBSD,
> >     using ipv4 addresses will fail. Consequently, you may only
> >     use ipv6 addresses or you can start java with
> >     -Djava.net.preferIPv4Stack=true and can only use ipv4
> >     addresses.
> > 
> It seems I missed that you did use the with_ipv6 flavor in the
> original
> email. I'll look into it when I find some free time.

I committed a fix for this in -current ports. At least now you can
create an ipv6 socket when building the port with FLAVOR=with_ipv6.
There may be other ipv6 bugs lurking as it seems it doesn't get much
use. Further testing is appreciated.

Stuart, I had a thought. Instead of an ipv6 flavor, it may be possible
to build with ipv6 on and change the default value of
java.net.preferIPv4Stack to true. If this works well, users may be
able to at least get one or the other stack working with the same
package by adjusting 

-Kurt

Reply via email to