DatagramChannel::disconnect appears to rebind socket to the wildcard address

Kurt Miller kurt at intricatesoftware.com
Thu Sep 26 12:40:33 UTC 2019


On Thu, 2019-09-26 at 13:32 +0100, Alan Bateman wrote:
> On 26/09/2019 13:15, Kurt Miller wrote:
> > 
> > :
> > Hi Alan,
> > 
> > This one I don't have any insight into. OpenBSD is like Windows
> > where it does not support IPv4-mapped IPv6 address at all. There
> > is no way to enable it with a knob (sysctl). Since the networking
> > implementation in the JVM on the Unix side of things depends on
> > this, OpenBSD can't support both IPv4 and IPv6 at the same time.
> > 
> > Ideally the dual socket implementation on the Windows side would
> > be utilized on the Unix side as well. The would allow for avoiding
> > the (perhaps debatable) security issues associated IPv4-mapped
> > IPv6 addresses that were raised by one of the initial pioneers of
> > IPv6, Itojun (Jun-ichiro Hagino) [1].
> > 
> > I believe both FreeBSD and NetBSD have sysctl's to enable IPv4-mapped
> > IPv6 address support, but is a system wide setting and puts an
> > administrator in the position of having to enable a less secure
> > setting to gain simultaneous IPv4 and IPv6 support in the JVM.
> > 
> > Sorry I've gone off on a tangent here, but I felt it was related
> > and perhaps could point out that the dual socket approach
> > on the Windows side of the JVM networking implementation would
> > likely be helpful for the Unix side as well.
> > 
> Thanks anyway. As you brought up Windows, I should mention that 
> Microsoft added support for dual stack sockets in Windows Vista and the 
> JDK uses on that platform too (one only outlier is legacy 
> MulticastSocket where it uses the two stack implementation but that 
> should eventually be replaced). This allows the JDK to use IPv4-mapped 
> IPv6 addresses when interfacing with the operating system (not on the 
> wire of course).
> 

Ah. Good to know. As you probably guessed, my understanding of
Windows networking in the JVM is pretty dated. I appreciate
the clarification and update on the direction it is going in.

Thanks,
-Kurt


More information about the bsd-port-dev mailing list