net: make use of internal/testenv package

Change-Id: I6644081df495cb92b3d208f867066f9acb08946f
Reviewed-on: https://go-review.googlesource.com/22074
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/net/udpsock_test.go b/src/net/udpsock_test.go
index 1404b7c..1da24b2 100644
--- a/src/net/udpsock_test.go
+++ b/src/net/udpsock_test.go
@@ -5,6 +5,7 @@
 package net
 
 import (
+	"internal/testenv"
 	"reflect"
 	"runtime"
 	"testing"
@@ -178,9 +179,7 @@
 }
 
 func TestUDPConnLocalName(t *testing.T) {
-	if testing.Short() || !*testExternal {
-		t.Skip("avoid external network")
-	}
+	testenv.MustHaveExternalNetwork(t)
 
 	for _, tt := range udpConnLocalNameTests {
 		c, err := ListenUDP(tt.net, tt.laddr)
@@ -234,9 +233,8 @@
 }
 
 func TestIPv6LinkLocalUnicastUDP(t *testing.T) {
-	if testing.Short() || !*testExternal {
-		t.Skip("avoid external network")
-	}
+	testenv.MustHaveExternalNetwork(t)
+
 	if !supportsIPv6 {
 		t.Skip("IPv6 is not supported")
 	}