mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
icmp: make use of nettest.SupportsRawIPSocket
Change-Id: I06585ba7e40c1653139520f3d67d96e5d86302ac Reviewed-on: https://go-review.googlesource.com/3401 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"golang.org/x/net/icmp"
|
||||
"golang.org/x/net/internal/iana"
|
||||
"golang.org/x/net/internal/nettest"
|
||||
"golang.org/x/net/ipv4"
|
||||
"golang.org/x/net/ipv6"
|
||||
)
|
||||
@@ -72,8 +73,10 @@ func TestPingGoogle(t *testing.T) {
|
||||
t.Skipf("not supported on %q", runtime.GOOS)
|
||||
}
|
||||
|
||||
m, ok := nettest.SupportsRawIPSocket()
|
||||
for i, tt := range pingGoogleTests {
|
||||
if tt.network[:2] == "ip" && os.Getuid() != 0 {
|
||||
if tt.network[:2] == "ip" && !ok {
|
||||
t.Log(m)
|
||||
continue
|
||||
}
|
||||
c, err := icmp.ListenPacket(tt.network, tt.address)
|
||||
|
||||
Reference in New Issue
Block a user