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: ResolveIPAddr cannot parse an IPv6 address enclosed in square brackets #3837

Closed
mikioh opened this issue Jul 17, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@mikioh
Copy link
Contributor

commented Jul 17, 2012

What steps will reproduce the problem?
1. call ResolveIPAddr("ip", "[::1]")
2.
3.

What is the expected output? What do you see instead?
No error return but got an error ``[::1]: no such host''.

Please use labels and text to provide additional information.
ResolveIPAddr("ip", "::1") works well, oops.
@mikioh

This comment has been minimized.

Copy link
Contributor Author

commented Aug 3, 2012

Comment 2:

Russ said at golang-dev:
--
NOT LGTM 
[::] is no more an IP address than 127.0.0.1:. The syntax for adding a 
port to an IPv6 address is [addr]:port, but the [] are not part of the 
addr. 
In addition to being consistent with the RFCs, this appears to be 
consistent with other Unix programs. For example, on my Mac: 
$ telnet '[::1]' 
[::1]: nodename nor servname provided, or not known 
$ telnet ::1 
Trying ::1... 
telnet: connect to address ::1: Connection refused 
telnet: Unable to connect to remote host 
$ 
--
Makes sense.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.