aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/golang.org/x/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/net/ipv6')
-rw-r--r--vendor/golang.org/x/net/ipv6/batch.go5
-rw-r--r--vendor/golang.org/x/net/ipv6/dgramopt.go35
-rw-r--r--vendor/golang.org/x/net/ipv6/doc.go2
-rw-r--r--vendor/golang.org/x/net/ipv6/endpoint.go13
-rw-r--r--vendor/golang.org/x/net/ipv6/gen.go4
-rw-r--r--vendor/golang.org/x/net/ipv6/genericopt.go10
-rw-r--r--vendor/golang.org/x/net/ipv6/helper.go1
-rw-r--r--vendor/golang.org/x/net/ipv6/iana.go10
-rw-r--r--vendor/golang.org/x/net/ipv6/icmp_test.go4
-rw-r--r--vendor/golang.org/x/net/ipv6/multicast_test.go4
-rw-r--r--vendor/golang.org/x/net/ipv6/multicastlistener_test.go10
-rw-r--r--vendor/golang.org/x/net/ipv6/multicastsockopt_test.go2
-rw-r--r--vendor/golang.org/x/net/ipv6/payload_cmsg.go9
-rw-r--r--vendor/golang.org/x/net/ipv6/payload_nocmsg.go9
-rw-r--r--vendor/golang.org/x/net/ipv6/readwrite_go1_8_test.go4
-rw-r--r--vendor/golang.org/x/net/ipv6/readwrite_go1_9_test.go4
-rw-r--r--vendor/golang.org/x/net/ipv6/readwrite_test.go2
-rw-r--r--vendor/golang.org/x/net/ipv6/sockopt_test.go6
-rw-r--r--vendor/golang.org/x/net/ipv6/unicast_test.go4
-rw-r--r--vendor/golang.org/x/net/ipv6/unicastsockopt_test.go4
20 files changed, 68 insertions, 74 deletions
diff --git a/vendor/golang.org/x/net/ipv6/batch.go b/vendor/golang.org/x/net/ipv6/batch.go
index 4f5fe68..10d6492 100644
--- a/vendor/golang.org/x/net/ipv6/batch.go
+++ b/vendor/golang.org/x/net/ipv6/batch.go
@@ -9,7 +9,6 @@ package ipv6
import (
"net"
"runtime"
- "syscall"
"golang.org/x/net/internal/socket"
)
@@ -67,7 +66,7 @@ type Message = socket.Message
// On other platforms, this method will read only a single message.
func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
switch runtime.GOOS {
case "linux":
@@ -98,7 +97,7 @@ func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
// On other platforms, this method will write only a single message.
func (c *payloadHandler) WriteBatch(ms []Message, flags int) (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
switch runtime.GOOS {
case "linux":
diff --git a/vendor/golang.org/x/net/ipv6/dgramopt.go b/vendor/golang.org/x/net/ipv6/dgramopt.go
index 703dafe..eea4fde 100644
--- a/vendor/golang.org/x/net/ipv6/dgramopt.go
+++ b/vendor/golang.org/x/net/ipv6/dgramopt.go
@@ -6,7 +6,6 @@ package ipv6
import (
"net"
- "syscall"
"golang.org/x/net/bpf"
)
@@ -15,7 +14,7 @@ import (
// multicast packets.
func (c *dgramOpt) MulticastHopLimit() (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
so, ok := sockOpts[ssoMulticastHopLimit]
if !ok {
@@ -28,7 +27,7 @@ func (c *dgramOpt) MulticastHopLimit() (int, error) {
// outgoing multicast packets.
func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoMulticastHopLimit]
if !ok {
@@ -41,7 +40,7 @@ func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {
// packet transmissions.
func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
if !c.ok() {
- return nil, syscall.EINVAL
+ return nil, errInvalidConn
}
so, ok := sockOpts[ssoMulticastInterface]
if !ok {
@@ -54,7 +53,7 @@ func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
// multicast packet transmissions.
func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoMulticastInterface]
if !ok {
@@ -67,7 +66,7 @@ func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
// should be copied and send back to the originator.
func (c *dgramOpt) MulticastLoopback() (bool, error) {
if !c.ok() {
- return false, syscall.EINVAL
+ return false, errInvalidConn
}
so, ok := sockOpts[ssoMulticastLoopback]
if !ok {
@@ -84,7 +83,7 @@ func (c *dgramOpt) MulticastLoopback() (bool, error) {
// should be copied and send back to the originator.
func (c *dgramOpt) SetMulticastLoopback(on bool) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoMulticastLoopback]
if !ok {
@@ -104,7 +103,7 @@ func (c *dgramOpt) SetMulticastLoopback(on bool) error {
// configuration.
func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoJoinGroup]
if !ok {
@@ -122,7 +121,7 @@ func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
// source-specific group.
func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoLeaveGroup]
if !ok {
@@ -143,7 +142,7 @@ func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
// routing configuration.
func (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoJoinSourceGroup]
if !ok {
@@ -164,7 +163,7 @@ func (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net
// interface ifi.
func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoLeaveSourceGroup]
if !ok {
@@ -186,7 +185,7 @@ func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source ne
// ifi.
func (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoBlockSourceGroup]
if !ok {
@@ -207,7 +206,7 @@ func (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source
// group by ExcludeSourceSpecificGroup again on the interface ifi.
func (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoUnblockSourceGroup]
if !ok {
@@ -230,7 +229,7 @@ func (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source
// field is located.
func (c *dgramOpt) Checksum() (on bool, offset int, err error) {
if !c.ok() {
- return false, 0, syscall.EINVAL
+ return false, 0, errInvalidConn
}
so, ok := sockOpts[ssoChecksum]
if !ok {
@@ -251,7 +250,7 @@ func (c *dgramOpt) Checksum() (on bool, offset int, err error) {
// checksum field is located.
func (c *dgramOpt) SetChecksum(on bool, offset int) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoChecksum]
if !ok {
@@ -266,7 +265,7 @@ func (c *dgramOpt) SetChecksum(on bool, offset int) error {
// ICMPFilter returns an ICMP filter.
func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {
if !c.ok() {
- return nil, syscall.EINVAL
+ return nil, errInvalidConn
}
so, ok := sockOpts[ssoICMPFilter]
if !ok {
@@ -278,7 +277,7 @@ func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) {
// SetICMPFilter deploys the ICMP filter.
func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoICMPFilter]
if !ok {
@@ -292,7 +291,7 @@ func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error {
// Only supported on Linux.
func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoAttachFilter]
if !ok {
diff --git a/vendor/golang.org/x/net/ipv6/doc.go b/vendor/golang.org/x/net/ipv6/doc.go
index 664a97d..cb40006 100644
--- a/vendor/golang.org/x/net/ipv6/doc.go
+++ b/vendor/golang.org/x/net/ipv6/doc.go
@@ -240,4 +240,4 @@
// IncludeSourceSpecificGroup may return an error.
package ipv6 // import "golang.org/x/net/ipv6"
-// BUG(mikio): This package is not implemented on NaCl and Plan 9.
+// BUG(mikio): This package is not implemented on JS, NaCl and Plan 9.
diff --git a/vendor/golang.org/x/net/ipv6/endpoint.go b/vendor/golang.org/x/net/ipv6/endpoint.go
index 0624c17..9325756 100644
--- a/vendor/golang.org/x/net/ipv6/endpoint.go
+++ b/vendor/golang.org/x/net/ipv6/endpoint.go
@@ -6,7 +6,6 @@ package ipv6
import (
"net"
- "syscall"
"time"
"golang.org/x/net/internal/socket"
@@ -34,7 +33,7 @@ func (c *genericOpt) ok() bool { return c != nil && c.Conn != nil }
// with the endpoint.
func (c *Conn) PathMTU() (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
so, ok := sockOpts[ssoPathMTU]
if !ok {
@@ -76,7 +75,7 @@ func (c *dgramOpt) ok() bool { return c != nil && c.Conn != nil }
// socket options.
func (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error {
if !c.payloadHandler.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
return setControlMessage(c.dgramOpt.Conn, &c.payloadHandler.rawOpt, cf, on)
}
@@ -85,7 +84,7 @@ func (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error {
// endpoint.
func (c *PacketConn) SetDeadline(t time.Time) error {
if !c.payloadHandler.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
return c.payloadHandler.SetDeadline(t)
}
@@ -94,7 +93,7 @@ func (c *PacketConn) SetDeadline(t time.Time) error {
// endpoint.
func (c *PacketConn) SetReadDeadline(t time.Time) error {
if !c.payloadHandler.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
return c.payloadHandler.SetReadDeadline(t)
}
@@ -103,7 +102,7 @@ func (c *PacketConn) SetReadDeadline(t time.Time) error {
// endpoint.
func (c *PacketConn) SetWriteDeadline(t time.Time) error {
if !c.payloadHandler.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
return c.payloadHandler.SetWriteDeadline(t)
}
@@ -111,7 +110,7 @@ func (c *PacketConn) SetWriteDeadline(t time.Time) error {
// Close closes the endpoint.
func (c *PacketConn) Close() error {
if !c.payloadHandler.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
return c.payloadHandler.Close()
}
diff --git a/vendor/golang.org/x/net/ipv6/gen.go b/vendor/golang.org/x/net/ipv6/gen.go
index 41886ec..5885664 100644
--- a/vendor/golang.org/x/net/ipv6/gen.go
+++ b/vendor/golang.org/x/net/ipv6/gen.go
@@ -72,7 +72,7 @@ var registries = []struct {
parse func(io.Writer, io.Reader) error
}{
{
- "http://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xml",
+ "https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xml",
parseICMPv6Parameters,
},
}
@@ -80,7 +80,7 @@ var registries = []struct {
func geniana() error {
var bb bytes.Buffer
fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n")
+ fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n")
fmt.Fprintf(&bb, "package ipv6\n\n")
for _, r := range registries {
resp, err := http.Get(r.url)
diff --git a/vendor/golang.org/x/net/ipv6/genericopt.go b/vendor/golang.org/x/net/ipv6/genericopt.go
index e9dbc2e..1a18f75 100644
--- a/vendor/golang.org/x/net/ipv6/genericopt.go
+++ b/vendor/golang.org/x/net/ipv6/genericopt.go
@@ -4,13 +4,11 @@
package ipv6
-import "syscall"
-
// TrafficClass returns the traffic class field value for outgoing
// packets.
func (c *genericOpt) TrafficClass() (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
so, ok := sockOpts[ssoTrafficClass]
if !ok {
@@ -23,7 +21,7 @@ func (c *genericOpt) TrafficClass() (int, error) {
// outgoing packets.
func (c *genericOpt) SetTrafficClass(tclass int) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoTrafficClass]
if !ok {
@@ -35,7 +33,7 @@ func (c *genericOpt) SetTrafficClass(tclass int) error {
// HopLimit returns the hop limit field value for outgoing packets.
func (c *genericOpt) HopLimit() (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
so, ok := sockOpts[ssoHopLimit]
if !ok {
@@ -48,7 +46,7 @@ func (c *genericOpt) HopLimit() (int, error) {
// packets.
func (c *genericOpt) SetHopLimit(hoplim int) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoHopLimit]
if !ok {
diff --git a/vendor/golang.org/x/net/ipv6/helper.go b/vendor/golang.org/x/net/ipv6/helper.go
index 2597401..7ac5352 100644
--- a/vendor/golang.org/x/net/ipv6/helper.go
+++ b/vendor/golang.org/x/net/ipv6/helper.go
@@ -10,6 +10,7 @@ import (
)
var (
+ errInvalidConn = errors.New("invalid connection")
errMissingAddress = errors.New("missing address")
errHeaderTooShort = errors.New("header too short")
errInvalidConnType = errors.New("invalid conn type")
diff --git a/vendor/golang.org/x/net/ipv6/iana.go b/vendor/golang.org/x/net/ipv6/iana.go
index 3c6214f..32db1aa 100644
--- a/vendor/golang.org/x/net/ipv6/iana.go
+++ b/vendor/golang.org/x/net/ipv6/iana.go
@@ -1,9 +1,9 @@
// go generate gen.go
-// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
+// Code generated by the command above; DO NOT EDIT.
package ipv6
-// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07
+// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09
const (
ICMPTypeDestinationUnreachable ICMPType = 1 // Destination Unreachable
ICMPTypePacketTooBig ICMPType = 2 // Packet Too Big
@@ -40,9 +40,11 @@ const (
ICMPTypeDuplicateAddressRequest ICMPType = 157 // Duplicate Address Request
ICMPTypeDuplicateAddressConfirmation ICMPType = 158 // Duplicate Address Confirmation
ICMPTypeMPLControl ICMPType = 159 // MPL Control Message
+ ICMPTypeExtendedEchoRequest ICMPType = 160 // Extended Echo Request
+ ICMPTypeExtendedEchoReply ICMPType = 161 // Extended Echo Reply
)
-// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07
+// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09
var icmpTypes = map[ICMPType]string{
1: "destination unreachable",
2: "packet too big",
@@ -79,4 +81,6 @@ var icmpTypes = map[ICMPType]string{
157: "duplicate address request",
158: "duplicate address confirmation",
159: "mpl control message",
+ 160: "extended echo request",
+ 161: "extended echo reply",
}
diff --git a/vendor/golang.org/x/net/ipv6/icmp_test.go b/vendor/golang.org/x/net/ipv6/icmp_test.go
index d8e9675..bdde2fd 100644
--- a/vendor/golang.org/x/net/ipv6/icmp_test.go
+++ b/vendor/golang.org/x/net/ipv6/icmp_test.go
@@ -34,7 +34,7 @@ func TestICMPString(t *testing.T) {
func TestICMPFilter(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
@@ -61,7 +61,7 @@ func TestICMPFilter(t *testing.T) {
func TestSetICMPFilter(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
diff --git a/vendor/golang.org/x/net/ipv6/multicast_test.go b/vendor/golang.org/x/net/ipv6/multicast_test.go
index 69a21cd..50442c3 100644
--- a/vendor/golang.org/x/net/ipv6/multicast_test.go
+++ b/vendor/golang.org/x/net/ipv6/multicast_test.go
@@ -29,7 +29,7 @@ var packetConnReadWriteMulticastUDPTests = []struct {
func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -129,7 +129,7 @@ var packetConnReadWriteMulticastICMPTests = []struct {
func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
diff --git a/vendor/golang.org/x/net/ipv6/multicastlistener_test.go b/vendor/golang.org/x/net/ipv6/multicastlistener_test.go
index b27713e..1ee0549 100644
--- a/vendor/golang.org/x/net/ipv6/multicastlistener_test.go
+++ b/vendor/golang.org/x/net/ipv6/multicastlistener_test.go
@@ -21,7 +21,7 @@ var udpMultipleGroupListenerTests = []net.Addr{
func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -61,7 +61,7 @@ func TestUDPSinglePacketConnWithMultipleGroupListeners(t *testing.T) {
func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -116,7 +116,7 @@ func TestUDPMultiplePacketConnWithMultipleGroupListeners(t *testing.T) {
func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -172,7 +172,7 @@ func TestUDPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
func TestIPSinglePacketConnWithSingleGroupListener(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -216,7 +216,7 @@ func TestIPPerInterfaceSinglePacketConnWithSingleGroupListener(t *testing.T) {
switch runtime.GOOS {
case "darwin", "dragonfly", "openbsd": // platforms that return fe80::1%lo0: bind: can't assign requested address
t.Skipf("not supported on %s", runtime.GOOS)
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
diff --git a/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go b/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go
index 9e6b902..9906e87 100644
--- a/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go
+++ b/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go
@@ -26,7 +26,7 @@ var packetConnMulticastSocketOptionTests = []struct {
func TestPacketConnMulticastSocketOptions(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
diff --git a/vendor/golang.org/x/net/ipv6/payload_cmsg.go b/vendor/golang.org/x/net/ipv6/payload_cmsg.go
index 4ee4b06..b7ccdbd 100644
--- a/vendor/golang.org/x/net/ipv6/payload_cmsg.go
+++ b/vendor/golang.org/x/net/ipv6/payload_cmsg.go
@@ -6,10 +6,7 @@
package ipv6
-import (
- "net"
- "syscall"
-)
+import "net"
// ReadFrom reads a payload of the received IPv6 datagram, from the
// endpoint c, copying the payload into b. It returns the number of
@@ -17,7 +14,7 @@ import (
// src of the received datagram.
func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {
if !c.ok() {
- return 0, nil, nil, syscall.EINVAL
+ return 0, nil, nil, errInvalidConn
}
return c.readFrom(b)
}
@@ -29,7 +26,7 @@ func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.
// cm may be nil if control of the outgoing datagram is not required.
func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
return c.writeTo(b, cm, dst)
}
diff --git a/vendor/golang.org/x/net/ipv6/payload_nocmsg.go b/vendor/golang.org/x/net/ipv6/payload_nocmsg.go
index 99a4354..8358507 100644
--- a/vendor/golang.org/x/net/ipv6/payload_nocmsg.go
+++ b/vendor/golang.org/x/net/ipv6/payload_nocmsg.go
@@ -6,10 +6,7 @@
package ipv6
-import (
- "net"
- "syscall"
-)
+import "net"
// ReadFrom reads a payload of the received IPv6 datagram, from the
// endpoint c, copying the payload into b. It returns the number of
@@ -17,7 +14,7 @@ import (
// src of the received datagram.
func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {
if !c.ok() {
- return 0, nil, nil, syscall.EINVAL
+ return 0, nil, nil, errInvalidConn
}
if n, src, err = c.PacketConn.ReadFrom(b); err != nil {
return 0, nil, nil, err
@@ -32,7 +29,7 @@ func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.
// cm may be nil if control of the outgoing datagram is not required.
func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
if dst == nil {
return 0, errMissingAddress
diff --git a/vendor/golang.org/x/net/ipv6/readwrite_go1_8_test.go b/vendor/golang.org/x/net/ipv6/readwrite_go1_8_test.go
index c11d92a..b3fbda1 100644
--- a/vendor/golang.org/x/net/ipv6/readwrite_go1_8_test.go
+++ b/vendor/golang.org/x/net/ipv6/readwrite_go1_8_test.go
@@ -22,7 +22,7 @@ import (
func BenchmarkPacketConnReadWriteUnicast(b *testing.B) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
b.Skipf("not supported on %s", runtime.GOOS)
}
@@ -123,7 +123,7 @@ func BenchmarkPacketConnReadWriteUnicast(b *testing.B) {
func TestPacketConnConcurrentReadWriteUnicast(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
diff --git a/vendor/golang.org/x/net/ipv6/readwrite_go1_9_test.go b/vendor/golang.org/x/net/ipv6/readwrite_go1_9_test.go
index e2fd733..7110619 100644
--- a/vendor/golang.org/x/net/ipv6/readwrite_go1_9_test.go
+++ b/vendor/golang.org/x/net/ipv6/readwrite_go1_9_test.go
@@ -22,7 +22,7 @@ import (
func BenchmarkPacketConnReadWriteUnicast(b *testing.B) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
b.Skipf("not supported on %s", runtime.GOOS)
}
@@ -169,7 +169,7 @@ func BenchmarkPacketConnReadWriteUnicast(b *testing.B) {
func TestPacketConnConcurrentReadWriteUnicast(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
diff --git a/vendor/golang.org/x/net/ipv6/readwrite_test.go b/vendor/golang.org/x/net/ipv6/readwrite_test.go
index 206b915..668208f 100644
--- a/vendor/golang.org/x/net/ipv6/readwrite_test.go
+++ b/vendor/golang.org/x/net/ipv6/readwrite_test.go
@@ -65,7 +65,7 @@ func BenchmarkReadWriteUnicast(b *testing.B) {
func TestPacketConnConcurrentReadWriteUnicastUDP(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
diff --git a/vendor/golang.org/x/net/ipv6/sockopt_test.go b/vendor/golang.org/x/net/ipv6/sockopt_test.go
index 774338d..add045e 100644
--- a/vendor/golang.org/x/net/ipv6/sockopt_test.go
+++ b/vendor/golang.org/x/net/ipv6/sockopt_test.go
@@ -19,7 +19,7 @@ var supportsIPv6 bool = nettest.SupportsIPv6()
func TestConnInitiatorPathMTU(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -57,7 +57,7 @@ func TestConnInitiatorPathMTU(t *testing.T) {
func TestConnResponderPathMTU(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -95,7 +95,7 @@ func TestConnResponderPathMTU(t *testing.T) {
func TestPacketConnChecksum(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
diff --git a/vendor/golang.org/x/net/ipv6/unicast_test.go b/vendor/golang.org/x/net/ipv6/unicast_test.go
index a0b7d95..159bb39 100644
--- a/vendor/golang.org/x/net/ipv6/unicast_test.go
+++ b/vendor/golang.org/x/net/ipv6/unicast_test.go
@@ -20,7 +20,7 @@ import (
func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -78,7 +78,7 @@ func TestPacketConnReadWriteUnicastUDP(t *testing.T) {
func TestPacketConnReadWriteUnicastICMP(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
diff --git a/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go b/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go
index e175dcc..69adefe 100644
--- a/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go
+++ b/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go
@@ -16,7 +16,7 @@ import (
func TestConnUnicastSocketOptions(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {
@@ -61,7 +61,7 @@ var packetConnUnicastSocketOptionTests = []struct {
func TestPacketConnUnicastSocketOptions(t *testing.T) {
switch runtime.GOOS {
- case "nacl", "plan9", "windows":
+ case "js", "nacl", "plan9", "windows":
t.Skipf("not supported on %s", runtime.GOOS)
}
if !supportsIPv6 {