aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/net/ipv4/genericopt.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/net/ipv4/genericopt.go')
-rw-r--r--vendor/golang.org/x/net/ipv4/genericopt.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/vendor/golang.org/x/net/ipv4/genericopt.go b/vendor/golang.org/x/net/ipv4/genericopt.go
index 119bf84..587ae4a 100644
--- a/vendor/golang.org/x/net/ipv4/genericopt.go
+++ b/vendor/golang.org/x/net/ipv4/genericopt.go
@@ -4,12 +4,10 @@
package ipv4
-import "syscall"
-
// TOS returns the type-of-service field value for outgoing packets.
func (c *genericOpt) TOS() (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
so, ok := sockOpts[ssoTOS]
if !ok {
@@ -22,7 +20,7 @@ func (c *genericOpt) TOS() (int, error) {
// packets.
func (c *genericOpt) SetTOS(tos int) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoTOS]
if !ok {
@@ -34,7 +32,7 @@ func (c *genericOpt) SetTOS(tos int) error {
// TTL returns the time-to-live field value for outgoing packets.
func (c *genericOpt) TTL() (int, error) {
if !c.ok() {
- return 0, syscall.EINVAL
+ return 0, errInvalidConn
}
so, ok := sockOpts[ssoTTL]
if !ok {
@@ -47,7 +45,7 @@ func (c *genericOpt) TTL() (int, error) {
// packets.
func (c *genericOpt) SetTTL(ttl int) error {
if !c.ok() {
- return syscall.EINVAL
+ return errInvalidConn
}
so, ok := sockOpts[ssoTTL]
if !ok {