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: Dial, Listen and ResolveAddr fail when the ipv6 entry in /etc/hosts has a zone identifier #8243

Closed
mikioh opened this issue Jun 19, 2014 · 5 comments
Milestone

Comments

@mikioh
Copy link
Contributor

@mikioh mikioh commented Jun 19, 2014

According to issue #8235, all connection setup and resolveaddr functions fail when the
target is has an ipv6 scoped addressing zone identifier. For example,

/etc/hosts
localhost fe80::1%lo0
livingroom fe80::2%en1
garage fe80::2%en2

Listen("tcp6", "localhost:0)"
Dial("tcp6", "livingloom:1234")
ResolveTCPAddr("tcp", "garage:http")
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 19, 2014

Comment 1:

Labels changed: added repo-main, release-go1.4.

@mikioh

This comment has been minimized.

Copy link
Contributor Author

@mikioh mikioh commented Jun 20, 2014

Comment 2:

To fix this issue, we need to handle zone identifier appropriately at;
- cgoLookupIPCNAME in cgo_unix.go, fortunately getaddrinfo returns ipv6 address with
zone identifier,
- readHosts in hosts.go, it doesn't parse ipv6 address with zone identifier correctly,
- resolveInternetAddr in ipsock.go and lookupIP in lookup.go, for now both functions
drop ipv6 zone identifier.
@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Sep 16, 2014

Comment 3:

Too late for 1.4.

Labels changed: added release-go1.5, removed release-go1.4.

Status changed to Accepted.

@mikioh

This comment has been minimized.

Copy link
Contributor Author

@mikioh mikioh commented Sep 16, 2014

Comment 4:

Labels changed: added release-none, removed release-go1.5.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented May 21, 2015

CL https://golang.org/cl/10306 mentions this issue.

@mikioh mikioh closed this in 9378493 Jun 2, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.