IPv6-only flag set on v6 sockets prevents the use of v4-mapped addresses

Daniel Gröber dxld at darkboxed.org
Sat Aug 19 07:22:45 UTC 2023


Hi Nathaniel,

On Mon, May 22, 2023 at 07:48:04AM +0100, Nathaniel Filardo wrote:
> This means that v4-mapped v6 addresses (::ffff:a.b.c.d) can be
> registered as peer endpoints, but the kernel very silently won't try
> to reach out.  Is that deliberate for some reason that eludes me?  If
> it is, could the userspace tooling be educated about v4-mapped
> addresses and translate them accordingly before handing them up to the
> kernel; if it isn't, could we drop the v6-only flag on the kernel
> socket?

Since I recently sent some patches touching the socket binding code I'm
worndering what the exact use case is here? DNS will never return these
addressess, I've only ever seen them used (internally to programs) when the
kernel returns them in non-v6only sockets. Is there some other context
these get returned in I'm missing?

I considered dropping the v6only flag for the new bind-to-address code path
I introduced but couldn't convince myself that there really is a good
reason to deviate from established wg behaviour here.

--Daniel


More information about the WireGuard mailing list