The fixes for #6290 and #18806 revealed that the use of special IP addresses, 0.0.0.0/8 or ::/128, as the destination is confusing especially when working with datagram transport protocols as described in #22811. It would be better to clarify and to implement consistent API semantics (because some of the special addresses is prohibited from using the destination IP address, so the existing behavior is Go-specific extended interpretation) for avoiding unnecessary confusion.
0.0.0.0/8 is defined in section 126.96.36.199 of RFC 1122 as "this host on this network." For historical reasons, some IP stack implementations allow to use 0.0.0.0/32 as the destination address of IP packets, but in general it's prohibited from using as the destination address,
::/128 is defined in section 2.5.2 of RFC 4291 as "the unspecified address." It's clearly stated that the unspecified address must not be used as the destination address and I've never seen IP stack implementation that allows to use the unspecified address as the destination address (I guess that IPv6 protocol conformance tools did a great job.)
The text was updated successfully, but these errors were encountered:
Using 0.0.0.0 for ListenUDP listens on all addresses. Calling LocalAddr
on that Conn returns 0.0.0.0. Sending to 0.0.0.0 doesn't seem to work on
Windows. See #22827.
Run-TryBot: Filippo Valsorda <email@example.com>
TryBot-Result: Go Bot <firstname.lastname@example.org>
Reviewed-by: David Chase <email@example.com>
Trust: Filippo Valsorda <firstname.lastname@example.org>