aboutsummaryrefslogtreecommitdiff
path: root/src/net/dial_test.go
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2017-04-14 17:43:42 +0900
committerMikio Hara <mikioh.mikioh@gmail.com>2017-04-15 22:22:09 +0000
commit6694a6888b7d3740b402cd3a2b7534e4d2d45c12 (patch)
treef29f85ccae36edfcfb9c9238e9b8f6f2b505290e /src/net/dial_test.go
parentbc2931372243043842161c0a60bd2f86ef9696ee (diff)
downloadgo-6694a6888b7d3740b402cd3a2b7534e4d2d45c12.tar.gz
go-6694a6888b7d3740b402cd3a2b7534e4d2d45c12.zip
net: delay IP protocol stack-snooping system calls
This change delays IP protocol stack-snooping system calls until the start of connection setup for the better experience with some system call auditing, such as seccomp on Linux. See #16789 for examples. Also updates the documentation on favoriteAddrFamily, which is the owner of stack-snooping system calls. Fixes #16789. Change-Id: I4af27bc1ed06ffb1f657b6f6381c328c1f41c66c Reviewed-on: https://go-review.googlesource.com/40750 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/dial_test.go')
-rw-r--r--src/net/dial_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/net/dial_test.go b/src/net/dial_test.go
index 22140005eb..669a368521 100644
--- a/src/net/dial_test.go
+++ b/src/net/dial_test.go
@@ -31,7 +31,7 @@ func TestProhibitionaryDialArg(t *testing.T) {
case "plan9":
t.Skipf("not supported on %s", runtime.GOOS)
}
- if !supportsIPv4map {
+ if !supportsIPv4map() {
t.Skip("mapping ipv4 address inside ipv6 address not supported")
}
@@ -81,7 +81,7 @@ func TestDialerDualStackFDLeak(t *testing.T) {
case "openbsd":
testenv.SkipFlaky(t, 15157)
}
- if !supportsIPv4 || !supportsIPv6 {
+ if !supportsIPv4() || !supportsIPv6() {
t.Skip("both IPv4 and IPv6 are required")
}
@@ -190,7 +190,7 @@ func dialClosedPort() (actual, expected time.Duration) {
func TestDialParallel(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
- if !supportsIPv4 || !supportsIPv6 {
+ if !supportsIPv4() || !supportsIPv6() {
t.Skip("both IPv4 and IPv6 are required")
}
@@ -361,7 +361,7 @@ func lookupSlowFast(ctx context.Context, fn func(context.Context, string) ([]IPA
func TestDialerFallbackDelay(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
- if !supportsIPv4 || !supportsIPv6 {
+ if !supportsIPv4() || !supportsIPv6() {
t.Skip("both IPv4 and IPv6 are required")
}
@@ -427,7 +427,7 @@ func TestDialerFallbackDelay(t *testing.T) {
}
func TestDialParallelSpuriousConnection(t *testing.T) {
- if !supportsIPv4 || !supportsIPv6 {
+ if !supportsIPv4() || !supportsIPv6() {
t.Skip("both IPv4 and IPv6 are required")
}
@@ -536,7 +536,7 @@ func TestDialerPartialDeadline(t *testing.T) {
}
func TestDialerLocalAddr(t *testing.T) {
- if !supportsIPv4 || !supportsIPv6 {
+ if !supportsIPv4() || !supportsIPv6() {
t.Skip("both IPv4 and IPv6 are required")
}
@@ -590,7 +590,7 @@ func TestDialerLocalAddr(t *testing.T) {
{"tcp", "::1", &UnixAddr{}, &AddrError{Err: "some error"}},
}
- if supportsIPv4map {
+ if supportsIPv4map() {
tests = append(tests, test{
"tcp", "127.0.0.1", &TCPAddr{IP: ParseIP("::")}, nil,
})
@@ -652,7 +652,7 @@ func TestDialerLocalAddr(t *testing.T) {
func TestDialerDualStack(t *testing.T) {
testenv.SkipFlaky(t, 13324)
- if !supportsIPv4 || !supportsIPv6 {
+ if !supportsIPv4() || !supportsIPv6() {
t.Skip("both IPv4 and IPv6 are required")
}
@@ -755,7 +755,7 @@ func TestDialCancel(t *testing.T) {
}
blackholeIPPort := JoinHostPort(slowDst4, "1234")
- if !supportsIPv4 {
+ if !supportsIPv4() {
blackholeIPPort = JoinHostPort(slowDst6, "1234")
}