vendor folder bump.
This commit is contained in:
35
vendor/golang.org/x/net/ipv4/helper.go
generated
vendored
35
vendor/golang.org/x/net/ipv4/helper.go
generated
vendored
@ -1,17 +1,16 @@
|
||||
// Copyright 2012 The Go Authors. All rights reserved.
|
||||
// Copyright 2012 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package ipv4
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"net"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var (
|
||||
errInvalidConn = errors.New("invalid connection")
|
||||
errMissingAddress = errors.New("missing address")
|
||||
errMissingHeader = errors.New("missing header")
|
||||
errHeaderTooShort = errors.New("header too short")
|
||||
@ -23,20 +22,8 @@ var (
|
||||
|
||||
// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.
|
||||
freebsdVersion uint32
|
||||
|
||||
nativeEndian binary.ByteOrder
|
||||
)
|
||||
|
||||
func init() {
|
||||
i := uint32(1)
|
||||
b := (*[4]byte)(unsafe.Pointer(&i))
|
||||
if b[0] == 1 {
|
||||
nativeEndian = binary.LittleEndian
|
||||
} else {
|
||||
nativeEndian = binary.BigEndian
|
||||
}
|
||||
}
|
||||
|
||||
func boolint(b bool) int {
|
||||
if b {
|
||||
return 1
|
||||
@ -57,3 +44,21 @@ func netAddrToIP4(a net.Addr) net.IP {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func opAddr(a net.Addr) net.Addr {
|
||||
switch a.(type) {
|
||||
case *net.TCPAddr:
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
case *net.UDPAddr:
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
case *net.IPAddr:
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
Reference in New Issue
Block a user