Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: clarification on the use of 0.0.0.0/8, ::/128 and ::ffff:0.0.0.0/128 as destination #22827

Open
mikioh opened this issue Nov 21, 2017 · 1 comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mikioh
Copy link
Contributor

mikioh commented Nov 21, 2017

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.

Just FYI:

  • 0.0.0.0/8 is defined in section 3.2.1.3 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.)
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 29, 2018
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Mar 29, 2018
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/301850 mentions this issue: net: fix BenchmarkWriteToReadFromUDP on Windows

gopherbot pushed a commit that referenced this issue Mar 15, 2021
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.

Change-Id: I4a48fbabe65a63e07600a65309977cec08a9c1e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/301850
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Trust: Filippo Valsorda <filippo@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants