소스 검색

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>
Tobias Klauser 7 년 전
부모
커밋
a67830ca58
4개의 변경된 파일0개의 추가작업 그리고 41개의 파일을 삭제
  1. 0 29
      internal/nettest/helper_bsd.go
  2. 0 4
      internal/nettest/helper_nobsd.go
  3. 0 4
      internal/nettest/helper_stub.go
  4. 0 4
      internal/nettest/helper_windows.go

+ 0 - 29
internal/nettest/helper_bsd.go

@@ -8,28 +8,8 @@ package nettest
 
 
 import (
 import (
 	"runtime"
 	"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 {
 func supportsIPv6MulticastDeliveryOnLoopback() bool {
 	switch runtime.GOOS {
 	switch runtime.GOOS {
 	case "freebsd":
 	case "freebsd":
@@ -38,16 +18,7 @@ func supportsIPv6MulticastDeliveryOnLoopback() bool {
 		// kernels don't deliver link-local scoped multicast
 		// kernels don't deliver link-local scoped multicast
 		// packets correctly.
 		// packets correctly.
 		return false
 		return false
-	case "darwin":
-		return !causesIPv6Crash()
 	default:
 	default:
 		return true
 		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
-}

+ 0 - 4
internal/nettest/helper_nobsd.go

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

+ 0 - 4
internal/nettest/helper_stub.go

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

+ 0 - 4
internal/nettest/helper_windows.go

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