Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(15)

Issue 4532101: code review 4532101: undo CL 4557058 / b4c2ffae7034 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by rsc
Modified:
13 years, 10 months ago
Reviewers:
CC:
golang-dev, bradfitz
Visibility:
Public.

Description

undo CL 4557058 / b4c2ffae7034 Using the getaddrinfo order is only okay if we are smart enough to try multiple addresses in Dial. Since the code does not do that, we must make the right first choice, regardless of what getaddrinfo does, and more often that not that means using the IPv4 address, even on IPv6 systems. With the CL applied, gotest fails in package net on OS X. helix.cam=; gotest ... --- FAIL: net.TestDialGoogleIPv4 (1.05 seconds) -- 74.125.226.179:80 -- -- www.google.com:80 -- Dial("tcp", "", "www.google.com:80") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family -- 74.125.226.179:http -- -- www.google.com:http -- Dial("tcp", "", "www.google.com:http") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family -- 074.125.226.179:0080 -- -- [::ffff:74.125.226.179]:80 -- -- [::ffff:4a7d:e2b3]:80 -- -- [0:0:0:0:0000:ffff:74.125.226.179]:80 -- -- [0:0:0:0:000000:ffff:74.125.226.179]:80 -- -- [0:0:0:0:0:ffff::74.125.226.179]:80 -- FAIL gotest: "./6.out" failed: exit status 1 ««« original CL description net: name-based destination address selection getaddrinfo() orders the addresses according to RFC 3484. This means when IPv6 is working on a host we get results like: []string = {"2001:4810::110", "66.117.47.214"} and when it's not working we get: []string = {"66.117.47.214", "2001:4810::110"} thus can drop firstFavoriteAddr. This also means /etc/gai.conf works on relevant systems. R=rsc, mikioh.mikioh CC=golang-dev http://codereview.appspot.com/4557058 Committer: Russ Cox <rsc@golang.org> »»»

Patch Set 1 #

Patch Set 2 : diff -r 0d10a13d15c0 https://go.googlecode.com/hg #

Patch Set 3 : diff -r e363f413166f https://go.googlecode.com/hg #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -2 lines) Patch
M src/pkg/net/iprawsock.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/net/ipsock.go View 1 2 chunks +18 lines, -1 line 0 comments Download

Messages

Total messages: 3
rsc
Hello golang-dev (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
13 years, 10 months ago (2011-05-31 19:45:44 UTC) #1
bradfitz
LGTM
13 years, 10 months ago (2011-06-01 19:43:34 UTC) #2
rsc
13 years, 10 months ago (2011-06-01 19:50:01 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=2e0aa4ab6d9f ***

undo CL 4557058 / b4c2ffae7034

Using the getaddrinfo order is only okay if we
are smart enough to try multiple addresses in Dial.
Since the code does not do that, we must make
the right first choice, regardless of what getaddrinfo
does, and more often that not that means using the
IPv4 address, even on IPv6 systems.  With the CL
applied, gotest fails in package net on OS X.

helix.cam=; gotest
...
--- FAIL: net.TestDialGoogleIPv4 (1.05 seconds)
        -- 74.125.226.179:80 --
        -- www.google.com:80 --
        Dial("tcp", "", "www.google.com:80") = _, dial tcp
[2001:4860:800f::69]:80: address family not supported by protocol family
        -- 74.125.226.179:http --
        -- www.google.com:http --
        Dial("tcp", "", "www.google.com:http") = _, dial tcp
[2001:4860:800f::69]:80: address family not supported by protocol family
        -- 074.125.226.179:0080 --
        -- [::ffff:74.125.226.179]:80 --
        -- [::ffff:4a7d:e2b3]:80 --
        -- [0:0:0:0:0000:ffff:74.125.226.179]:80 --
        -- [0:0:0:0:000000:ffff:74.125.226.179]:80 --
        -- [0:0:0:0:0:ffff::74.125.226.179]:80 --
FAIL
gotest: "./6.out" failed: exit status 1


««« original CL description
net: name-based destination address selection

getaddrinfo() orders the addresses according to RFC 3484.

This means when IPv6 is working on a host we get results like:
    []string = {"2001:4810::110", "66.117.47.214"}

and when it's not working we get:
    []string = {"66.117.47.214", "2001:4810::110"}

thus can drop firstFavoriteAddr.

This also means /etc/gai.conf works on relevant systems.

R=rsc, mikioh.mikioh
CC=golang-dev
http://codereview.appspot.com/4557058

Committer: Russ Cox <rsc@golang.org>
»»»

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/4532101
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b