Skip to content

Commit

Permalink
ipv6: enable IPV6_PATHMTU and IPV6_TCLASS tests on darwin/ios
Browse files Browse the repository at this point in the history
These options are supported on all darwin/ios versions currently
supported by Go.

Change-Id: I4cf1f435889cbbfbfb12321114e3c2e18bb613b2
Reviewed-on: https://go-review.googlesource.com/c/net/+/305350
Trust: Tobias Klauser <[email protected]>
Run-TryBot: Tobias Klauser <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
tklauser committed Mar 29, 2021
1 parent db2394d commit df645c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
14 changes: 2 additions & 12 deletions ipv6/sockopt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ func TestConnInitiatorPathMTU(t *testing.T) {
defer c.Close()

if pmtu, err := ipv6.NewConn(c).PathMTU(); err != nil {
switch runtime.GOOS {
case "darwin", "ios": // older darwin kernels don't support IPV6_PATHMTU option
t.Logf("not supported on %s", runtime.GOOS)
default:
t.Fatal(err)
}
t.Fatal(err)
} else {
t.Logf("path mtu for %v: %v", c.RemoteAddr(), pmtu)
}
Expand Down Expand Up @@ -78,12 +73,7 @@ func TestConnResponderPathMTU(t *testing.T) {
defer c.Close()

if pmtu, err := ipv6.NewConn(c).PathMTU(); err != nil {
switch runtime.GOOS {
case "darwin", "ios": // older darwin kernels don't support IPV6_PATHMTU option
t.Logf("not supported on %s", runtime.GOOS)
default:
t.Fatal(err)
}
t.Fatal(err)
} else {
t.Logf("path mtu for %v: %v", c.RemoteAddr(), pmtu)
}
Expand Down
6 changes: 0 additions & 6 deletions ipv6/unicastsockopt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ func testUnicastSocketOptions(t *testing.T, c testIPv6UnicastConn) {

tclass := iana.DiffServCS0 | iana.NotECNTransport
if err := c.SetTrafficClass(tclass); err != nil {
switch runtime.GOOS {
case "darwin", "ios": // older darwin kernels don't support IPV6_TCLASS option
t.Logf("not supported on %s", runtime.GOOS)
goto next
}
t.Fatal(err)
}
if v, err := c.TrafficClass(); err != nil {
Expand All @@ -109,7 +104,6 @@ func testUnicastSocketOptions(t *testing.T, c testIPv6UnicastConn) {
t.Fatalf("got %v; want %v", v, tclass)
}

next:
hoplim := 255
if err := c.SetHopLimit(hoplim); err != nil {
t.Fatal(err)
Expand Down

0 comments on commit df645c7

Please sign in to comment.