]> Cypherpunks repositories - gostls13.git/commitdiff
vendor: re-vendor golang.org/x/net to fix Dragonfly build
authorTobias Klauser <tklauser@distanz.ch>
Mon, 21 Oct 2019 12:02:18 +0000 (14:02 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Mon, 21 Oct 2019 13:35:49 +0000 (13:35 +0000)
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: Bryan C. Mills <bcmills@google.com>
13 files changed:
src/go.mod
src/go.sum
src/net/interface_test.go
src/vendor/golang.org/x/net/dns/dnsmessage/message.go
src/vendor/golang.org/x/net/http2/hpack/encode.go
src/vendor/golang.org/x/net/route/address.go
src/vendor/golang.org/x/net/route/message.go
src/vendor/golang.org/x/net/route/route.go
src/vendor/golang.org/x/net/route/route_classic.go
src/vendor/golang.org/x/net/route/sys.go
src/vendor/golang.org/x/net/route/sys_dragonfly.go
src/vendor/golang.org/x/net/route/zsys_dragonfly.go
src/vendor/modules.txt

index 8d8c89b5fb6c62647fea8d992a7ddbda2e1fb097..984ec1e572ace8a5159c1926b44bf1299a999e48 100644 (file)
@@ -4,7 +4,7 @@ go 1.14
 
 require (
        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/text v0.3.2 // indirect
 )
index e358118e4cbd6845086f195ad1cf3e43cd6c32df..89a846d79de1c5e049ba8c1c88dab3432d0147b4 100644 (file)
@@ -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/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 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-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20191021124707-24d2ffbea1e8 h1:L4W1teiyF4Jl6VuapLNV/LYho36udiBQsfbNu7eRMeo=
+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-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190529130038-5219a1e1c5f8 h1:2WjIC11WRITGlVWmyLXKjzIVj1ZwoWZ//tadeUUV6/o=
index 4163fa9d9a928708a3f485e7b210b127e0ac5a14..7379a8ffb3919712ee2dc48a02e1bf2c09eeba4b 100644 (file)
@@ -8,7 +8,6 @@ package net
 
 import (
        "fmt"
-       "internal/testenv"
        "reflect"
        "runtime"
        "testing"
@@ -58,8 +57,6 @@ func condSkipInterfaceTest(t *testing.T) {
                if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
                        t.Skipf("sysctl is not supported on iOS")
                }
-       case "dragonfly":
-               testenv.SkipFlaky(t, 34368)
        }
 }
 
index 13fbc0814e5e603e7ee08e01fac8e98af6c402d6..82bcdcc838c2f0296b33e2381bd7f167c3c87270 100644 (file)
@@ -1660,7 +1660,7 @@ func (h *ResourceHeader) fixLen(msg []byte, lenOff int, preLen int) error {
        return nil
 }
 
-// EDNS(0) wire costants.
+// EDNS(0) wire constants.
 const (
        edns0Version = 0
 
index 1565cf2702d27ac4e614d3747c92ef8f267457ad..97f17831fc55b8c944d501320dbc5d2f03016e39 100644 (file)
@@ -150,7 +150,7 @@ func appendIndexed(dst []byte, i uint64) []byte {
 // extended buffer.
 //
 // 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.
 func appendNewName(dst []byte, f HeaderField, indexing bool) []byte {
        dst = append(dst, encodeTypeByte(indexing, f.Sensitive))
index e6bfa39e93b02dfe1952e55510b180a59e4a0420..b71528191f60d079418b21513c21d2fdb36fcc46 100644 (file)
@@ -222,7 +222,7 @@ func parseKernelInetAddr(af int, b []byte) (int, Addr, error) {
        //   the routing message boundary
        l := int(b[0])
        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.
                if l == 0 || len(b) > roundup(l) {
                        l = roundup(l)
index 0fa7e09f468ed125526c47160a4ebaf2b273f8a2..80c482ae94a6a6a78680c60951dc21d3a79cc7e1 100644 (file)
@@ -45,7 +45,7 @@ func ParseRIB(typ RIBType, b []byte) ([]Message, error) {
                if len(b) < l {
                        return nil, errMessageTooShort
                }
-               if b[2] != sysRTM_VERSION {
+               if b[2] != rtmVersion {
                        b = b[l:]
                        continue
                }
index 8cb64f789b33fad54c8253c245dec262ed695f54..bba7ed7ef4ef327d30a18e66b21a1090f82f87ec 100644 (file)
@@ -73,7 +73,7 @@ type RouteMessage struct {
        Version int     // message version
        Type    int     // message type
        Flags   int     // route flags
-       Index   int     // interface index when atatched
+       Index   int     // interface index when attached
        ID      uintptr // sender's identifier; usually process ID
        Seq     int     // sequence number
        Err     error   // error on requested operation
index 02fa688309c27bcdd9f726234f3d7e77387701a1..a7d3864646b7c9c2cf92b246a765a1370b989edd 100644 (file)
@@ -25,7 +25,7 @@ func (m *RouteMessage) marshal() ([]byte, error) {
        b := make([]byte, l)
        nativeEndian.PutUint16(b[:2], uint16(l))
        if m.Version == 0 {
-               b[2] = sysRTM_VERSION
+               b[2] = rtmVersion
        } else {
                b[2] = byte(m.Version)
        }
index 13933f9af756149c745639ead2152960b6c5f616..a0ab3e9c73bdbeed753bf41d2414318d9b7b1e75 100644 (file)
@@ -11,6 +11,7 @@ import "unsafe"
 var (
        nativeEndian binaryByteOrder
        kernelAlign  int
+       rtmVersion   byte
        wireFormats  map[int]*wireFormat
 )
 
@@ -22,6 +23,8 @@ func init() {
        } else {
                nativeEndian = bigEndian
        }
+       // might get overridden in probeRoutingStack
+       rtmVersion = sysRTM_VERSION
        kernelAlign, wireFormats = probeRoutingStack()
 }
 
index 0c14bc2b4d46d1a67d3a9a044e64957c68c63acd..a138951f94576618f5088c731756ad63f576f6db 100644 (file)
@@ -4,7 +4,10 @@
 
 package route
 
-import "unsafe"
+import (
+       "syscall"
+       "unsafe"
+)
 
 func (typ RIBType) parseable() bool { return true }
 
@@ -56,6 +59,15 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
        ifmam.parse = ifmam.parseInterfaceMulticastAddrMessage
        ifanm := &wireFormat{extOff: sizeofIfAnnouncemsghdrDragonFlyBSD4, bodyOff: sizeofIfAnnouncemsghdrDragonFlyBSD4}
        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{
                sysRTM_ADD:        rtm,
                sysRTM_DELETE:     rtm,
index 8ed2d4d550c15b58210eed0e4c301a9712d591e4..34f0eaaa42b0435cdf213fbb254c2cf9a12b4883 100644 (file)
@@ -46,8 +46,6 @@ const (
        sysRTM_REDIRECT   = 0x6
        sysRTM_MISS       = 0x7
        sysRTM_LOCK       = 0x8
-       sysRTM_OLDADD     = 0x9
-       sysRTM_OLDDEL     = 0xa
        sysRTM_RESOLVE    = 0xb
        sysRTM_NEWADDR    = 0xc
        sysRTM_DELADDR    = 0xd
@@ -89,6 +87,8 @@ const (
        sizeofIfmaMsghdrDragonFlyBSD4       = 0x10
        sizeofIfAnnouncemsghdrDragonFlyBSD4 = 0x18
 
+       sizeofIfaMsghdrDragonFlyBSD58 = 0x18
+
        sizeofRtMsghdrDragonFlyBSD4  = 0x98
        sizeofRtMetricsDragonFlyBSD4 = 0x70
 
index c0f37845b01d988397f47db2d2c3695f6d3675fc..f91341daca235ba9e538133902e2bd8b1c91eb06 100644 (file)
@@ -8,7 +8,7 @@ golang.org/x/crypto/hkdf
 golang.org/x/crypto/internal/chacha20
 golang.org/x/crypto/internal/subtle
 golang.org/x/crypto/poly1305
-# golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7
+# golang.org/x/net v0.0.0-20191021124707-24d2ffbea1e8
 ## explicit
 golang.org/x/net/dns/dnsmessage
 golang.org/x/net/http/httpguts