mirror of
https://github.com/golang/go.git
synced 2025-11-07 04:01:00 +00:00
net: protocol family adaptive address family selection
This CL will help to make an adaptive address family selection possible when an any address family, vague network string such as "ip", "tcp" or "udp" is passed to Dial and Listen API. Fixes #1769. R=bradfitz, rsc CC=golang-dev https://golang.org/cl/4438066
This commit is contained in:
parent
b701cf3332
commit
2ddcad96d7
11 changed files with 183 additions and 95 deletions
|
|
@ -62,7 +62,7 @@ func TestFileListener(t *testing.T) {
|
|||
}
|
||||
testFileListener(t, "tcp", "127.0.0.1")
|
||||
testFileListener(t, "tcp", "127.0.0.1")
|
||||
if kernelSupportsIPv6() {
|
||||
if supportsIPv6 && supportsIPv4map {
|
||||
testFileListener(t, "tcp", "[::ffff:127.0.0.1]")
|
||||
testFileListener(t, "tcp", "127.0.0.1")
|
||||
testFileListener(t, "tcp", "[::ffff:127.0.0.1]")
|
||||
|
|
@ -121,8 +121,10 @@ func TestFilePacketConn(t *testing.T) {
|
|||
}
|
||||
testFilePacketConnListen(t, "udp", "127.0.0.1:0")
|
||||
testFilePacketConnDial(t, "udp", "127.0.0.1:12345")
|
||||
if kernelSupportsIPv6() {
|
||||
if supportsIPv6 {
|
||||
testFilePacketConnListen(t, "udp", "[::1]:0")
|
||||
}
|
||||
if supportsIPv6 && supportsIPv4map {
|
||||
testFilePacketConnDial(t, "udp", "[::ffff:127.0.0.1]:12345")
|
||||
}
|
||||
if syscall.OS == "linux" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue