default http client and ipv6

1,415 views
Skip to first unread message

Vasiliy Tolstov

unread,
Aug 20, 2014, 7:26:23 AM8/20/14
to golang-nuts
Hello. I find small issue. For example i have domain www.test.com that
have 2 A records and 2 AAAA records.

When in go i'm try to http.Get("http://www.test.com") and does not
have ipv4 address configured on interface i have error, that says
about unable to connect to ipv4 address of domain. I'm try to use
DualStack in dialer transport, but this is not helps.
Now i manually resolve records and walk, but does it possible to
automatic determine destination address if ipv4/ipv6 addresses not
exists?

--
Vasiliy Tolstov,
e-mail: v.to...@selfip.ru
jabber: va...@selfip.ru

Brad Fitzpatrick

unread,
Aug 20, 2014, 7:47:47 PM8/20/14
to Vasiliy Tolstov, Mikio Hara, golang-nuts
Mikio? Shouldn't this work out of the box?



--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mikio Hara

unread,
Aug 21, 2014, 4:45:16 AM8/21/14
to Brad Fitzpatrick, Vasiliy Tolstov, golang-nuts
can you tell us what happens when you run http://play.golang.org/p/ehvPanPT5t ?

On Thu, Aug 21, 2014 at 8:47 AM, Brad Fitzpatrick <brad...@golang.org> wrote:

> Mikio? Shouldn't this work out of the box?

yes--if he has a concrete ipv6 connectivity for both control and
forwarding planes.

no--i'm afraid of something went wrong with the techniques such as
map-t/e, ds-lite, 464xlat, 6rd, nat64/dns64, blah blah.

Mikio Hara

unread,
Aug 21, 2014, 5:59:54 AM8/21/14
to Mikio Hara, Brad Fitzpatrick, Vasiliy Tolstov, golang-nuts
ah, perhaps he needs a convenient solution for the plain-old 6-6-6 (client-transport-server) case with single dial call not using dualstack toggle, hm.

Vasiliy Tolstov

unread,
Aug 21, 2014, 8:21:31 AM8/21/14
to Mikio Hara, Brad Fitzpatrick, golang-nuts
Sorry for screenshot. As for note - i'm compile without CGO (static
binary). And i'm try to use dualstack but in this use case it not
works.
Because in absence of ipv4 client tries to connect to ipv4 address.
shot-2014-08-21_16-14-31.png

James Bardin

unread,
Aug 21, 2014, 10:26:06 AM8/21/14
to golan...@googlegroups.com, mikioh...@gmail.com, brad...@golang.org

Does it work if you only Dial for IPv6?
Maybe DualStack is failing when there's no local IPv4 connectivity at all.

Vasiliy Tolstov

unread,
Aug 21, 2014, 10:50:13 AM8/21/14
to James Bardin, golan...@googlegroups.com, mikioh...@gmail.com, brad...@golang.org
2014-08-21 18:26 GMT+04:00 James Bardin <j.ba...@gmail.com>:
> Does it work if you only Dial for IPv6?
> Maybe DualStack is failing when there's no local IPv4 connectivity at all.

I can't see difference if i switch dualstack true/false.

James Bardin

unread,
Aug 21, 2014, 10:54:23 AM8/21/14
to Vasiliy Tolstov, golan...@googlegroups.com, Mikio Hara, brad...@golang.org
On Thu, Aug 21, 2014 at 10:49 AM, Vasiliy Tolstov <v.to...@selfip.ru> wrote:
2014-08-21 18:26 GMT+04:00 James Bardin <j.ba...@gmail.com>:
> Does it work if you only Dial for IPv6?
> Maybe DualStack is failing when there's no local IPv4 connectivity at all.

I can't see difference if i switch dualstack true/false.


I know, because IPv4 is what's failing. Try dialing for IPv6 *only* (not DualStack)

Vasiliy Tolstov

unread,
Aug 21, 2014, 10:56:09 AM8/21/14
to James Bardin, golan...@googlegroups.com, Mikio Hara, brad...@golang.org
2014-08-21 18:54 GMT+04:00 James Bardin <j.ba...@gmail.com>:
> I know, because IPv4 is what's failing. Try dialing for IPv6 *only* (not
> DualStack)


In case of http client i can't understand how can i do that.

James Bardin

unread,
Aug 21, 2014, 11:05:08 AM8/21/14
to Vasiliy Tolstov, golan...@googlegroups.com, Mikio Hara, brad...@golang.org
On Thu, Aug 21, 2014 at 10:55 AM, Vasiliy Tolstov <v.to...@selfip.ru> wrote:
2014-08-21 18:54 GMT+04:00 James Bardin <j.ba...@gmail.com>:
> I know, because IPv4 is what's failing. Try dialing for IPv6 *only* (not
> DualStack)


In case of http client i can't understand how can i do that.


Ah, ok

You should be able to try this out by giving the Transport a Dial function like so:

func DialTCP6(network, addr string) (net.Conn, error) {
return net.Dial("tcp6", addr)
}
 

Vasiliy Tolstov

unread,
Aug 21, 2014, 11:15:58 AM8/21/14
to James Bardin, golan...@googlegroups.com, Mikio Hara, brad...@golang.org
2014-08-21 19:04 GMT+04:00 James Bardin <j.ba...@gmail.com>:
> Ah, ok
>
> You should be able to try this out by giving the Transport a Dial function
> like so:
>
> func DialTCP6(network, addr string) (net.Conn, error) {
> return net.Dial("tcp6", addr)
> }


i'm always get no suitable address found error

Mikio Hara

unread,
Aug 21, 2014, 12:33:21 PM8/21/14
to Vasiliy Tolstov, Brad Fitzpatrick, golang-nuts
On Thu, Aug 21, 2014 at 9:21 PM, Vasiliy Tolstov <v.to...@selfip.ru> wrote:

> Sorry for screenshot. As for note - i'm compile without CGO (static binary).

looks like it's a bug of builtin dns stub resolver. can you please
file an issue, thanks.

http://golang.org/project/
https://code.google.com/p/go/issues/entry

Mikio Hara

unread,
Aug 22, 2014, 5:20:32 AM8/22/14
to Vasiliy Tolstov, Brad Fitzpatrick, golang-nuts
hi,

have you already filed an issue? as the screenshot described, you are
using non-global routable ipv6 address (fed0::/64?) so we can assume
that you have implemented nptv6 (known as nat66) or similar stuff and
builtin dns stub resolver had some trouble with that stuff. we cannot
dig up the issue without your help.

Vasiliy Tolstov

unread,
Aug 22, 2014, 7:23:12 AM8/22/14
to Mikio Hara, Brad Fitzpatrick, golang-nuts
2014-08-22 13:20 GMT+04:00 Mikio Hara <mikioh...@gmail.com>:
> hi,
>
> have you already filed an issue? as the screenshot described, you are
> using non-global routable ipv6 address (fed0::/64?) so we can assume
> that you have implemented nptv6 (known as nat66) or similar stuff and
> builtin dns stub resolver had some trouble with that stuff. we cannot
> dig up the issue without your help.


No i don't file issue. This is ipv6 address i'm assign via qemu user
network. Packets from virtual machine goes to qemu process and routed
to external world.
I'm try with global routed address but nothing changed.

Mikio Hara

unread,
Aug 22, 2014, 7:53:11 AM8/22/14
to Vasiliy Tolstov, Brad Fitzpatrick, golang-nuts
On Fri, Aug 22, 2014 at 8:21 PM, Vasiliy Tolstov <v.to...@selfip.ru> wrote:

> No i don't file issue.

is there any reason?

Vasiliy Tolstov

unread,
Aug 22, 2014, 7:57:19 AM8/22/14
to Mikio Hara, Brad Fitzpatrick, golang-nuts
2014-08-22 15:52 GMT+04:00 Mikio Hara <mikioh...@gmail.com>:
> is there any reason?


I have no time =), sorry. Today i'm file a issue.

Vasiliy Tolstov

unread,
Aug 22, 2014, 2:32:43 PM8/22/14
to Vasiliy Tolstov, Mikio Hara, Brad Fitzpatrick, golang-nuts
Reply all
Reply to author
Forward
0 new messages