diff options
Diffstat (limited to 'libgo/go/net/ipsock.go')
-rw-r--r-- | libgo/go/net/ipsock.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libgo/go/net/ipsock.go b/libgo/go/net/ipsock.go index 7d0684d..0f5da25 100644 --- a/libgo/go/net/ipsock.go +++ b/libgo/go/net/ipsock.go @@ -7,6 +7,7 @@ package net import ( "context" "internal/bytealg" + "runtime" "sync" ) @@ -44,6 +45,13 @@ func supportsIPv6() bool { // IPv4 address inside an IPv6 address at transport layer // protocols. See RFC 4291, RFC 4038 and RFC 3493. func supportsIPv4map() bool { + // Some operating systems provide no support for mapping IPv4 + // addresses to IPv6, and a runtime check is unnecessary. + switch runtime.GOOS { + case "dragonfly", "openbsd": + return false + } + ipStackCaps.Once.Do(ipStackCaps.probe) return ipStackCaps.ipv4MappedIPv6Enabled } |