• Mikio Hara's avatar
    net: make Dial and Listen behavior consistent across over platforms · b5dc8724
    Mikio Hara authored
    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
    b5dc8724
sockopt_bsd.go 1.73 KB