mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
update vendor/ dir to latest w/o heroku, moby
had to lock a lot of things in place
This commit is contained in:
9
vendor/golang.org/x/net/icmp/paramprob.go
generated
vendored
9
vendor/golang.org/x/net/icmp/paramprob.go
generated
vendored
@@ -4,7 +4,10 @@
|
||||
|
||||
package icmp
|
||||
|
||||
import "golang.org/x/net/internal/iana"
|
||||
import (
|
||||
"encoding/binary"
|
||||
"golang.org/x/net/internal/iana"
|
||||
)
|
||||
|
||||
// A ParamProb represents an ICMP parameter problem message body.
|
||||
type ParamProb struct {
|
||||
@@ -26,7 +29,7 @@ func (p *ParamProb) Len(proto int) int {
|
||||
func (p *ParamProb) Marshal(proto int) ([]byte, error) {
|
||||
if proto == iana.ProtocolIPv6ICMP {
|
||||
b := make([]byte, p.Len(proto))
|
||||
b[0], b[1], b[2], b[3] = byte(p.Pointer>>24), byte(p.Pointer>>16), byte(p.Pointer>>8), byte(p.Pointer)
|
||||
binary.BigEndian.PutUint32(b[:4], uint32(p.Pointer))
|
||||
copy(b[4:], p.Data)
|
||||
return b, nil
|
||||
}
|
||||
@@ -45,7 +48,7 @@ func parseParamProb(proto int, b []byte) (MessageBody, error) {
|
||||
}
|
||||
p := &ParamProb{}
|
||||
if proto == iana.ProtocolIPv6ICMP {
|
||||
p.Pointer = uintptr(b[0])<<24 | uintptr(b[1])<<16 | uintptr(b[2])<<8 | uintptr(b[3])
|
||||
p.Pointer = uintptr(binary.BigEndian.Uint32(b[:4]))
|
||||
p.Data = make([]byte, len(b)-4)
|
||||
copy(p.Data, b[4:])
|
||||
return p, nil
|
||||
|
||||
Reference in New Issue
Block a user