Update dependencies
This commit is contained in:
parent
7ad76273c0
commit
540efa03c4
485 changed files with 57821 additions and 12429 deletions
11
vendor/golang.org/x/net/ipv4/header.go
generated
vendored
11
vendor/golang.org/x/net/ipv4/header.go
generated
vendored
|
@ -57,7 +57,7 @@ func (h *Header) String() string {
|
|||
// This may differ from the wire format, depending on the system.
|
||||
func (h *Header) Marshal() ([]byte, error) {
|
||||
if h == nil {
|
||||
return nil, errInvalidConn
|
||||
return nil, errNilHeader
|
||||
}
|
||||
if h.Len < HeaderLen {
|
||||
return nil, errHeaderTooShort
|
||||
|
@ -107,12 +107,15 @@ func (h *Header) Marshal() ([]byte, error) {
|
|||
// local system.
|
||||
// This may differ from the wire format, depending on the system.
|
||||
func (h *Header) Parse(b []byte) error {
|
||||
if h == nil || len(b) < HeaderLen {
|
||||
if h == nil || b == nil {
|
||||
return errNilHeader
|
||||
}
|
||||
if len(b) < HeaderLen {
|
||||
return errHeaderTooShort
|
||||
}
|
||||
hdrlen := int(b[0]&0x0f) << 2
|
||||
if hdrlen > len(b) {
|
||||
return errBufferTooShort
|
||||
if len(b) < hdrlen {
|
||||
return errExtHeaderTooShort
|
||||
}
|
||||
h.Version = int(b[0] >> 4)
|
||||
h.Len = hdrlen
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue