Commit 6917b3c8 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

vendor: re-vendor golang.org/x/net to fix Dragonfly build

This picks up CL 202317 which fixes golang.org/x/net for Dragonfly
master (upcoming 5.8 release). Also re-enable the interface tests
disabled in CL 201482.

Vendored using:

    $ go get golang.org/x/net@24d2ffbea1e8
    $ go mod tidy
    $ go mod vendor

Fixes #34368

Change-Id: Iac152b7ffaa607bfedbb4024b4e1ffc9b649d689
Reviewed-on: https://go-review.googlesource.com/c/go/+/202438
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
parent e01e9176
...@@ -4,7 +4,7 @@ go 1.14 ...@@ -4,7 +4,7 @@ go 1.14
require ( require (
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 golang.org/x/net v0.0.0-20191021124707-24d2ffbea1e8
golang.org/x/sys v0.0.0-20190529130038-5219a1e1c5f8 // indirect golang.org/x/sys v0.0.0-20190529130038-5219a1e1c5f8 // indirect
golang.org/x/text v0.3.2 // indirect golang.org/x/text v0.3.2 // indirect
) )
...@@ -2,8 +2,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk ...@@ -2,8 +2,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH9uqVPRCUVUDhs0wnbA= golang.org/x/net v0.0.0-20191021124707-24d2ffbea1e8 h1:L4W1teiyF4Jl6VuapLNV/LYho36udiBQsfbNu7eRMeo=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191021124707-24d2ffbea1e8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190529130038-5219a1e1c5f8 h1:2WjIC11WRITGlVWmyLXKjzIVj1ZwoWZ//tadeUUV6/o= golang.org/x/sys v0.0.0-20190529130038-5219a1e1c5f8 h1:2WjIC11WRITGlVWmyLXKjzIVj1ZwoWZ//tadeUUV6/o=
......
...@@ -8,7 +8,6 @@ package net ...@@ -8,7 +8,6 @@ package net
import ( import (
"fmt" "fmt"
"internal/testenv"
"reflect" "reflect"
"runtime" "runtime"
"testing" "testing"
...@@ -58,8 +57,6 @@ func condSkipInterfaceTest(t *testing.T) { ...@@ -58,8 +57,6 @@ func condSkipInterfaceTest(t *testing.T) {
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
t.Skipf("sysctl is not supported on iOS") t.Skipf("sysctl is not supported on iOS")
} }
case "dragonfly":
testenv.SkipFlaky(t, 34368)
} }
} }
......
...@@ -1660,7 +1660,7 @@ func (h *ResourceHeader) fixLen(msg []byte, lenOff int, preLen int) error { ...@@ -1660,7 +1660,7 @@ func (h *ResourceHeader) fixLen(msg []byte, lenOff int, preLen int) error {
return nil return nil
} }
// EDNS(0) wire costants. // EDNS(0) wire constants.
const ( const (
edns0Version = 0 edns0Version = 0
......
...@@ -150,7 +150,7 @@ func appendIndexed(dst []byte, i uint64) []byte { ...@@ -150,7 +150,7 @@ func appendIndexed(dst []byte, i uint64) []byte {
// extended buffer. // extended buffer.
// //
// If f.Sensitive is true, "Never Indexed" representation is used. If // If f.Sensitive is true, "Never Indexed" representation is used. If
// f.Sensitive is false and indexing is true, "Inremental Indexing" // f.Sensitive is false and indexing is true, "Incremental Indexing"
// representation is used. // representation is used.
func appendNewName(dst []byte, f HeaderField, indexing bool) []byte { func appendNewName(dst []byte, f HeaderField, indexing bool) []byte {
dst = append(dst, encodeTypeByte(indexing, f.Sensitive)) dst = append(dst, encodeTypeByte(indexing, f.Sensitive))
......
...@@ -222,7 +222,7 @@ func parseKernelInetAddr(af int, b []byte) (int, Addr, error) { ...@@ -222,7 +222,7 @@ func parseKernelInetAddr(af int, b []byte) (int, Addr, error) {
// the routing message boundary // the routing message boundary
l := int(b[0]) l := int(b[0])
if runtime.GOOS == "darwin" { if runtime.GOOS == "darwin" {
// On Darwn, an address in the kernel form is also // On Darwin, an address in the kernel form is also
// used as a message filler. // used as a message filler.
if l == 0 || len(b) > roundup(l) { if l == 0 || len(b) > roundup(l) {
l = roundup(l) l = roundup(l)
......
...@@ -45,7 +45,7 @@ func ParseRIB(typ RIBType, b []byte) ([]Message, error) { ...@@ -45,7 +45,7 @@ func ParseRIB(typ RIBType, b []byte) ([]Message, error) {
if len(b) < l { if len(b) < l {
return nil, errMessageTooShort return nil, errMessageTooShort
} }
if b[2] != sysRTM_VERSION { if b[2] != rtmVersion {
b = b[l:] b = b[l:]
continue continue
} }
......
...@@ -73,7 +73,7 @@ type RouteMessage struct { ...@@ -73,7 +73,7 @@ type RouteMessage struct {
Version int // message version Version int // message version
Type int // message type Type int // message type
Flags int // route flags Flags int // route flags
Index int // interface index when atatched Index int // interface index when attached
ID uintptr // sender's identifier; usually process ID ID uintptr // sender's identifier; usually process ID
Seq int // sequence number Seq int // sequence number
Err error // error on requested operation Err error // error on requested operation
......
...@@ -25,7 +25,7 @@ func (m *RouteMessage) marshal() ([]byte, error) { ...@@ -25,7 +25,7 @@ func (m *RouteMessage) marshal() ([]byte, error) {
b := make([]byte, l) b := make([]byte, l)
nativeEndian.PutUint16(b[:2], uint16(l)) nativeEndian.PutUint16(b[:2], uint16(l))
if m.Version == 0 { if m.Version == 0 {
b[2] = sysRTM_VERSION b[2] = rtmVersion
} else { } else {
b[2] = byte(m.Version) b[2] = byte(m.Version)
} }
......
...@@ -11,6 +11,7 @@ import "unsafe" ...@@ -11,6 +11,7 @@ import "unsafe"
var ( var (
nativeEndian binaryByteOrder nativeEndian binaryByteOrder
kernelAlign int kernelAlign int
rtmVersion byte
wireFormats map[int]*wireFormat wireFormats map[int]*wireFormat
) )
...@@ -22,6 +23,8 @@ func init() { ...@@ -22,6 +23,8 @@ func init() {
} else { } else {
nativeEndian = bigEndian nativeEndian = bigEndian
} }
// might get overridden in probeRoutingStack
rtmVersion = sysRTM_VERSION
kernelAlign, wireFormats = probeRoutingStack() kernelAlign, wireFormats = probeRoutingStack()
} }
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
package route package route
import "unsafe" import (
"syscall"
"unsafe"
)
func (typ RIBType) parseable() bool { return true } func (typ RIBType) parseable() bool { return true }
...@@ -56,6 +59,15 @@ func probeRoutingStack() (int, map[int]*wireFormat) { ...@@ -56,6 +59,15 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
ifmam.parse = ifmam.parseInterfaceMulticastAddrMessage ifmam.parse = ifmam.parseInterfaceMulticastAddrMessage
ifanm := &wireFormat{extOff: sizeofIfAnnouncemsghdrDragonFlyBSD4, bodyOff: sizeofIfAnnouncemsghdrDragonFlyBSD4} ifanm := &wireFormat{extOff: sizeofIfAnnouncemsghdrDragonFlyBSD4, bodyOff: sizeofIfAnnouncemsghdrDragonFlyBSD4}
ifanm.parse = ifanm.parseInterfaceAnnounceMessage ifanm.parse = ifanm.parseInterfaceAnnounceMessage
rel, _ := syscall.SysctlUint32("kern.osreldate")
if rel >= 500705 {
// https://github.com/DragonFlyBSD/DragonFlyBSD/commit/43a373152df2d405c9940983e584e6a25e76632d
// but only the size of struct ifa_msghdr actually changed
rtmVersion = 7
ifam.bodyOff = sizeofIfaMsghdrDragonFlyBSD58
}
return int(unsafe.Sizeof(p)), map[int]*wireFormat{ return int(unsafe.Sizeof(p)), map[int]*wireFormat{
sysRTM_ADD: rtm, sysRTM_ADD: rtm,
sysRTM_DELETE: rtm, sysRTM_DELETE: rtm,
......
...@@ -46,8 +46,6 @@ const ( ...@@ -46,8 +46,6 @@ const (
sysRTM_REDIRECT = 0x6 sysRTM_REDIRECT = 0x6
sysRTM_MISS = 0x7 sysRTM_MISS = 0x7
sysRTM_LOCK = 0x8 sysRTM_LOCK = 0x8
sysRTM_OLDADD = 0x9
sysRTM_OLDDEL = 0xa
sysRTM_RESOLVE = 0xb sysRTM_RESOLVE = 0xb
sysRTM_NEWADDR = 0xc sysRTM_NEWADDR = 0xc
sysRTM_DELADDR = 0xd sysRTM_DELADDR = 0xd
...@@ -89,6 +87,8 @@ const ( ...@@ -89,6 +87,8 @@ const (
sizeofIfmaMsghdrDragonFlyBSD4 = 0x10 sizeofIfmaMsghdrDragonFlyBSD4 = 0x10
sizeofIfAnnouncemsghdrDragonFlyBSD4 = 0x18 sizeofIfAnnouncemsghdrDragonFlyBSD4 = 0x18
sizeofIfaMsghdrDragonFlyBSD58 = 0x18
sizeofRtMsghdrDragonFlyBSD4 = 0x98 sizeofRtMsghdrDragonFlyBSD4 = 0x98
sizeofRtMetricsDragonFlyBSD4 = 0x70 sizeofRtMetricsDragonFlyBSD4 = 0x70
......
...@@ -8,7 +8,7 @@ golang.org/x/crypto/hkdf ...@@ -8,7 +8,7 @@ golang.org/x/crypto/hkdf
golang.org/x/crypto/internal/chacha20 golang.org/x/crypto/internal/chacha20
golang.org/x/crypto/internal/subtle golang.org/x/crypto/internal/subtle
golang.org/x/crypto/poly1305 golang.org/x/crypto/poly1305
# golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 # golang.org/x/net v0.0.0-20191021124707-24d2ffbea1e8
## explicit ## explicit
golang.org/x/net/dns/dnsmessage golang.org/x/net/dns/dnsmessage
golang.org/x/net/http/httpguts golang.org/x/net/http/httpguts
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment