-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
proposal: net: add support for "let localhost be localhost" #22826
Comments
Can you briefly describe the proposal, or do I need to read that URL? Are you proposing that we hard-code DNS resolution of "localhost" to always mean 127.0.0.1 or ::1? |
Sort of. Simply, implementing mapping between the label |
Could you send a CL? I imagine once it's an official RFC we'll accept it. But it would be nice to see the CL earlier. |
Will write a CL while watching Australian Open 2018, probably. |
This should be put on hold until it is actually approved and has an RFC number. |
[Status report] Looks like the draft has been stalled, probably it's hard to make a consensus about pushing the draft to the next stage, IESG, perhaps because of the lack of a general solution to the problem domain. If you are waiting for the fix of this issue, it's better to find out another way. I'll keep this issue open for a while, but close at some point. |
In tests, we force binding to localhost to avoid OS firewall warning dialogs. But for IPv6, we were trying (and failing) to bind to 127.0.0.1. You'd think we'd just say "localhost", but that's apparently ill defined. See https://tools.ietf.org/html/draft-ietf-dnsop-let-localhost-be-localhost and golang/go#22826. (It's bitten me in the past, but I can't remember specific bugs.) So use "::1" explicitly for "udp6", which makes the test quieter.
In tests, we force binding to localhost to avoid OS firewall warning dialogs. But for IPv6, we were trying (and failing) to bind to 127.0.0.1. You'd think we'd just say "localhost", but that's apparently ill defined. See https://tools.ietf.org/html/draft-ietf-dnsop-let-localhost-be-localhost and golang/go#22826. (It's bitten me in the past, but I can't remember specific bugs.) So use "::1" explicitly for "udp6", which makes the test quieter. (cherry picked from commit 450cfed)
This is the only way I could find to make the test pass on _my_ macOS machine: ``` Darwin mr-6.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64 ``` I don't understand the problem here, and I am not sure what the implications are; this probably breaks the test on IPv4-only machines if those still exist. Without this change, or even when using 127.0.0.1, nothing is received. ``` === RUN TestRelay_RelayLine === RUN TestRelay_RelayLine/multiple_lines udp.go:85: At: /Users/mr/src/github.com/prometheus/statsd_exporter/pkg/relay/relay_test.go:68 udp.go:115: Expected to find: "foo5:100|c|#tag1:bar,#tag2:baz\n" udp.go:116: But got: "" --- FAIL: TestRelay_RelayLine (0.00s) --- FAIL: TestRelay_RelayLine/multiple_lines (0.00s) FAIL FAIL github.com/prometheus/statsd_exporter/pkg/relay 1.809s FAIL ``` Is there a better or more well understood solution? Possibly related: `localhost` is [not well defined](golang/go#22826). Signed-off-by: Matthias Rampke <[email protected]>
The I-D https://tools.ietf.org/html/draft-ietf-dnsop-let-localhost-be-localhost became an IETF dnsop-wg draft. It would be better to support the feature once the I-D has been published as an RFC for the sake of convenience instead of saying "sorry, there's no direct relationship between the IPv4 loopback address prefix
127.0.0.0/8
or the IPv6 loopback address::1
and the namelocalhost
, that's just the convention", although the resolution forlocalhost
still remains as a burden of applications from security perspective.The text was updated successfully, but these errors were encountered: