mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
ipv6: move unexposed error values into helper.go
Change-Id: Iac5121529bb1044e64724937f5d5e2bff8a336a6 Reviewed-on: https://go-review.googlesource.com/16321 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
@@ -5,18 +5,11 @@
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var (
|
||||
errMissingAddress = errors.New("missing address")
|
||||
errInvalidConnType = errors.New("invalid conn type")
|
||||
errNoSuchInterface = errors.New("no such interface")
|
||||
)
|
||||
|
||||
// Note that RFC 3542 obsoletes RFC 2292 but OS X Snow Leopard and the
|
||||
// former still support RFC 2292 only. Please be aware that almost
|
||||
// all protocol implementations prohibit using a combination of RFC
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
package ipv6
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
)
|
||||
@@ -37,7 +36,7 @@ func (h *Header) String() string {
|
||||
// ParseHeader parses b as an IPv6 base header.
|
||||
func ParseHeader(b []byte) (*Header, error) {
|
||||
if len(b) < HeaderLen {
|
||||
return nil, errors.New("header too short")
|
||||
return nil, errHeaderTooShort
|
||||
}
|
||||
h := &Header{
|
||||
Version: int(b[0]) >> 4,
|
||||
|
||||
@@ -9,7 +9,13 @@ import (
|
||||
"net"
|
||||
)
|
||||
|
||||
var errOpNoSupport = errors.New("operation not supported")
|
||||
var (
|
||||
errMissingAddress = errors.New("missing address")
|
||||
errHeaderTooShort = errors.New("header too short")
|
||||
errInvalidConnType = errors.New("invalid conn type")
|
||||
errOpNoSupport = errors.New("operation not supported")
|
||||
errNoSuchInterface = errors.New("no such interface")
|
||||
)
|
||||
|
||||
func boolint(b bool) int {
|
||||
if b {
|
||||
|
||||
Reference in New Issue
Block a user