internal/nettest: drop causesIPv6Crash

The causesIPv6Crash helper function was only needed on macOS 10.8 and
before. However, Go 1.11 requires at least macOS 10.11, so drop the
check altogether. Also remove the unused implementations for all other
geese.

Change-Id: I7459f942374e7e2e6c14b787e2dfc493de67bedc
Reviewed-on: https://go-review.googlesource.com/c/156497
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Tobias Klauser
2019-01-07 10:13:27 +01:00
committed by Brad Fitzpatrick
parent 927f97764c
commit a67830ca58
4 changed files with 0 additions and 41 deletions

View File

@@ -8,28 +8,8 @@ package nettest
import (
"runtime"
"strconv"
"strings"
"syscall"
)
var darwinVersion int
func init() {
if runtime.GOOS == "darwin" {
// See http://support.apple.com/kb/HT1633.
s, err := syscall.Sysctl("kern.osrelease")
if err != nil {
return
}
ss := strings.Split(s, ".")
if len(ss) == 0 {
return
}
darwinVersion, _ = strconv.Atoi(ss[0])
}
}
func supportsIPv6MulticastDeliveryOnLoopback() bool {
switch runtime.GOOS {
case "freebsd":
@@ -38,16 +18,7 @@ func supportsIPv6MulticastDeliveryOnLoopback() bool {
// kernels don't deliver link-local scoped multicast
// packets correctly.
return false
case "darwin":
return !causesIPv6Crash()
default:
return true
}
}
func causesIPv6Crash() bool {
// We see some kernel crash when running IPv6 with IP-level
// options on Darwin kernel version 12 or below.
// See golang.org/issues/17015.
return darwinVersion < 13
}

View File

@@ -9,7 +9,3 @@ package nettest
func supportsIPv6MulticastDeliveryOnLoopback() bool {
return true
}
func causesIPv6Crash() bool {
return false
}

View File

@@ -23,10 +23,6 @@ func supportsIPv6MulticastDeliveryOnLoopback() bool {
return false
}
func causesIPv6Crash() bool {
return false
}
func protocolNotSupported(err error) bool {
return false
}

View File

@@ -36,7 +36,3 @@ func supportsRawIPSocket() (string, bool) {
func supportsIPv6MulticastDeliveryOnLoopback() bool {
return true
}
func causesIPv6Crash() bool {
return false
}