sender source IP address on UDP socket bound to INADDR_ANY in golang

Lutz Donnerhacke lutz at donnerhacke.de
Sun May 16 11:59:45 UTC 2021


On Sun, May 16, 2021 at 09:18:55PM +1000, Peter Jeremy via freebsd-net wrote:
> This is getting outside my expertise but my understanding is that
> the idea behind using IPv4-mapped addressed is to simplify building
> dual-stack applications, particularly during the early introduction
> of IPv6.  The main benefit is that it made it possible to support
> both IPv4 and IPv6 without needing 2 sockets - which means you
> can stick to doing an accept() on a blocking socket, rather than
> needing to use poll() or select() etc with a pair of non-blocking
> sockets.

Correct. IPv4-mapped addresses exists only for this purpose, they do not
have any meaning outside of this API. Unfortunatly the API is incomplete,
but still heavily used. For this purpose the API might be stretched over its
limits.



More information about the freebsd-net mailing list