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 only connects to IPv4 addresses #1166

Closed
gopherbot opened this issue Oct 6, 2010 · 4 comments
Closed

net: dial only connects to IPv4 addresses #1166

gopherbot opened this issue Oct 6, 2010 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by bortzmeyer:

What steps will reproduce the problem?
1. 8g dial.go
2. 8l -o dial dial.8
3. ./dial whois.nic.fr 43 

What is the expected output?

Connection with whois.nic.fr:43 ([2001:660:3003:2::4:24]:43) OK

What do you see instead?

Connection with whois.nic.fr:43 (192.134.4.25:43) OK

Which compiler are you using (5g, 6g, 8g, gccgo)?

8g

Which operating system are you using?

Debian "squeeze"

Which revision are you using?  (hg identify)

46c566a29e1f tip

Please provide any additional information below.

I was expecting an IPv6 connection, like with telnet:

% telnet whois.nic.fr 43
Trying 2001:660:3003:2::4:24...
Connected to whois.nic.fr.
Escape character is '^]'.
...


Isn't it the fault of LookupHost in dnsclient.go, which only queries A records?

Attachments:

  1. dial.go (724 bytes)
@rsc
Copy link
Contributor

rsc commented Oct 6, 2010

Comment 1:

Yes, this is one of many such bugs in the package.
The long term plan is to change package net to use
the C library instead of doing so much itself, and
that will address concerns like this one.
Not going to touch the current code until that change
is made.

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Oct 6, 2010

Comment 2:

Yes, this is one of many such bugs in the package.
The long term plan is to change package net to use
the C library instead of doing so much itself, and
that will address concerns like this one.
Not going to touch the current code until that change
is made.

@gopherbot
Copy link
Contributor Author

Comment 3 by bortzmeyer:

OK. This is a pity since it will mean importing C issues (such as
memory management) but I cannot think of a better solution.
Reimplementing everything that getaddrinfo do and keeping it in synch
with the future evolutions of the libc (DNSSEC, for instance), is not
reasonable.

@rsc
Copy link
Contributor

rsc commented Apr 20, 2011

Comment 5:

$ 6.out whois.nic.fr 43
Connection with whois.nic.fr:43 ([2001:660:3003:2::4:24]:43) OK
$ 
fixed during conversion of net to use cgo

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants