aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/net/sockopt_bsd.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/sockopt_bsd.go')
-rw-r--r--libgo/go/net/sockopt_bsd.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libgo/go/net/sockopt_bsd.go b/libgo/go/net/sockopt_bsd.go
index 7b8b8d9..e52fa88 100644
--- a/libgo/go/net/sockopt_bsd.go
+++ b/libgo/go/net/sockopt_bsd.go
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package net
@@ -25,7 +26,7 @@ func setDefaultSockopts(s, family, sotype int, ipv6only bool) error {
syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_PORTRANGE, syscall.IPV6_PORTRANGE_HIGH)
}
}
- if supportsIPv4map() && family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW {
+ if family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW && supportsIPv4map() {
// Allow both IP versions even if the OS default
// is otherwise. Note that some operating systems
// never admit this option.