diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-07-20 15:22:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-20 15:22:49 -0700 |
commit | 58839cefb50e56ae5b157b37e9814ae83ceee70b (patch) | |
tree | 5de966481678096fc9567f74f96673b34a65127c /vendor/golang.org/x/net/icmp/ipv4.go | |
parent | e2f4492eadb5d3c58606b1fdd5774b63a07c236a (diff) | |
download | chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.tar.gz chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.tar.bz2 chat-58839cefb50e56ae5b157b37e9814ae83ceee70b.zip |
Upgrading server dependancies (#6984)
Diffstat (limited to 'vendor/golang.org/x/net/icmp/ipv4.go')
-rw-r--r-- | vendor/golang.org/x/net/icmp/ipv4.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/golang.org/x/net/icmp/ipv4.go b/vendor/golang.org/x/net/icmp/ipv4.go index 729ddc97c..ffc66ed4d 100644 --- a/vendor/golang.org/x/net/icmp/ipv4.go +++ b/vendor/golang.org/x/net/icmp/ipv4.go @@ -9,9 +9,14 @@ import ( "net" "runtime" + "golang.org/x/net/internal/socket" "golang.org/x/net/ipv4" ) +// freebsdVersion is set in sys_freebsd.go. +// See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html. +var freebsdVersion uint32 + // ParseIPv4Header parses b as an IPv4 header of ICMP error message // invoking packet, which is contained in ICMP error message. func ParseIPv4Header(b []byte) (*ipv4.Header, error) { @@ -36,12 +41,12 @@ func ParseIPv4Header(b []byte) (*ipv4.Header, error) { } switch runtime.GOOS { case "darwin": - h.TotalLen = int(nativeEndian.Uint16(b[2:4])) + h.TotalLen = int(socket.NativeEndian.Uint16(b[2:4])) case "freebsd": if freebsdVersion >= 1000000 { h.TotalLen = int(binary.BigEndian.Uint16(b[2:4])) } else { - h.TotalLen = int(nativeEndian.Uint16(b[2:4])) + h.TotalLen = int(socket.NativeEndian.Uint16(b[2:4])) } default: h.TotalLen = int(binary.BigEndian.Uint16(b[2:4])) |