]> Cypherpunks repositories - gostls13.git/commit
net: make Dial and Listen behavior consistent across over platforms
authorMikio Hara <mikioh.mikioh@gmail.com>
Mon, 5 Mar 2012 15:13:10 +0000 (00:13 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Mon, 5 Mar 2012 15:13:10 +0000 (00:13 +0900)
commitb5dc8724cb1f13c4419641fd3b666ebd46408f21
treeec1b0ce0e980baaf42f589ebc7fb7bac95194f99
parentfae0d35043b7a3f8f3673d79cbf1d4798ee5e5aa
net: make Dial and Listen behavior consistent across over platforms

This CL changes the behavior of Dial and Listen API family.

Previous Dial and Listen allow a combo of "tcp6" and IPv4 or IPv6
IPv4-mapped address as its argument, but it also makes slightly
different behaviors between Linux and other platforms. This CL fixes
such differences across over platforms by tweaking IP-level socket
option IPV6_V6ONLY. Consequently new Dial and Listen API family will
reject arguments consists of "tcp6" and IPv4 or IPv6 IPv4-mapped
address.

This CL also adds a bit clarified unicast listener tests.

Fixes #2581.

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/5677086
13 files changed:
src/pkg/net/file_test.go
src/pkg/net/iprawsock_posix.go
src/pkg/net/ipsock_posix.go
src/pkg/net/net_test.go
src/pkg/net/server_test.go
src/pkg/net/sock.go
src/pkg/net/sockopt_bsd.go
src/pkg/net/sockopt_linux.go
src/pkg/net/sockopt_windows.go
src/pkg/net/tcpsock_posix.go
src/pkg/net/udpsock_posix.go
src/pkg/net/unicast_test.go
src/pkg/net/unixsock_posix.go