|
@@ -62,7 +62,10 @@ func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
|
|
|
cf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface
|
|
cf := ipv4.FlagTTL | ipv4.FlagDst | ipv4.FlagInterface
|
|
|
|
|
|
|
|
for i, toggle := range []bool{true, false, true} {
|
|
for i, toggle := range []bool{true, false, true} {
|
|
|
- if err := p.SetControlMessage(cf, toggle); err != nil && !protocolNotSupported(err) {
|
|
|
|
|
|
|
+ if err := p.SetControlMessage(cf, toggle); err != nil {
|
|
|
|
|
+ if protocolNotSupported(err) {
|
|
|
|
|
+ t.Skipf("not supported on %q", runtime.GOOS)
|
|
|
|
|
+ }
|
|
|
t.Fatalf("ipv4.PacketConn.SetControlMessage failed: %v", err)
|
|
t.Fatalf("ipv4.PacketConn.SetControlMessage failed: %v", err)
|
|
|
}
|
|
}
|
|
|
if err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|
|
if err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|
|
@@ -135,7 +138,10 @@ func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
t.Fatalf("icmp.Message.Marshal failed: %v", err)
|
|
t.Fatalf("icmp.Message.Marshal failed: %v", err)
|
|
|
}
|
|
}
|
|
|
- if err := p.SetControlMessage(cf, toggle); err != nil && !protocolNotSupported(err) {
|
|
|
|
|
|
|
+ if err := p.SetControlMessage(cf, toggle); err != nil {
|
|
|
|
|
+ if protocolNotSupported(err) {
|
|
|
|
|
+ t.Skipf("not supported on %q", runtime.GOOS)
|
|
|
|
|
+ }
|
|
|
t.Fatalf("ipv4.PacketConn.SetControlMessage failed: %v", err)
|
|
t.Fatalf("ipv4.PacketConn.SetControlMessage failed: %v", err)
|
|
|
}
|
|
}
|
|
|
if err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|
|
if err := p.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|
|
@@ -228,7 +234,10 @@ func TestRawConnReadWriteMulticastICMP(t *testing.T) {
|
|
|
Protocol: 1,
|
|
Protocol: 1,
|
|
|
Dst: dst.IP,
|
|
Dst: dst.IP,
|
|
|
}
|
|
}
|
|
|
- if err := r.SetControlMessage(cf, toggle); err != nil && !protocolNotSupported(err) {
|
|
|
|
|
|
|
+ if err := r.SetControlMessage(cf, toggle); err != nil {
|
|
|
|
|
+ if protocolNotSupported(err) {
|
|
|
|
|
+ t.Skipf("not supported on %q", runtime.GOOS)
|
|
|
|
|
+ }
|
|
|
t.Fatalf("ipv4.RawConn.SetControlMessage failed: %v", err)
|
|
t.Fatalf("ipv4.RawConn.SetControlMessage failed: %v", err)
|
|
|
}
|
|
}
|
|
|
if err := r.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|
|
if err := r.SetDeadline(time.Now().Add(200 * time.Millisecond)); err != nil {
|