]> Cypherpunks repositories - gostls13.git/commitdiff
vendor/golang_org/x/net/route: refresh from upstream
authorRuss Cox <rsc@golang.org>
Thu, 26 Oct 2017 16:00:18 +0000 (12:00 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 26 Oct 2017 20:20:52 +0000 (20:20 +0000)
This picks up a few changes and should stop the macOS crashes.

Fixes #22456.

Change-Id: I7e0aae119a5564fcfaa16eeab7422bdd5ff0497b
Reviewed-on: https://go-review.googlesource.com/73691
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/vendor/golang_org/x/net/route/defs_openbsd.go
src/vendor/golang_org/x/net/route/route_classic.go
src/vendor/golang_org/x/net/route/route_test.go
src/vendor/golang_org/x/net/route/sys_darwin.go
src/vendor/golang_org/x/net/route/sys_dragonfly.go
src/vendor/golang_org/x/net/route/sys_freebsd.go
src/vendor/golang_org/x/net/route/sys_netbsd.go
src/vendor/golang_org/x/net/route/sys_openbsd.go
src/vendor/golang_org/x/net/route/zsys_openbsd.go

index 0f66d3619c75b8b508b2ad2d21372e8a779bc5ec..173bb5d51381a7ab0e726a0a3d8ae38fe52a9674 100644 (file)
@@ -69,6 +69,9 @@ const (
        sysRTM_IFINFO     = C.RTM_IFINFO
        sysRTM_IFANNOUNCE = C.RTM_IFANNOUNCE
        sysRTM_DESYNC     = C.RTM_DESYNC
+       sysRTM_INVALIDATE = C.RTM_INVALIDATE
+       sysRTM_BFD        = C.RTM_BFD
+       sysRTM_PROPOSAL   = C.RTM_PROPOSAL
 
        sysRTA_DST     = C.RTA_DST
        sysRTA_GATEWAY = C.RTA_GATEWAY
@@ -81,6 +84,10 @@ const (
        sysRTA_SRC     = C.RTA_SRC
        sysRTA_SRCMASK = C.RTA_SRCMASK
        sysRTA_LABEL   = C.RTA_LABEL
+       sysRTA_BFD     = C.RTA_BFD
+       sysRTA_DNS     = C.RTA_DNS
+       sysRTA_STATIC  = C.RTA_STATIC
+       sysRTA_SEARCH  = C.RTA_SEARCH
 
        sysRTAX_DST     = C.RTAX_DST
        sysRTAX_GATEWAY = C.RTAX_GATEWAY
@@ -93,6 +100,10 @@ const (
        sysRTAX_SRC     = C.RTAX_SRC
        sysRTAX_SRCMASK = C.RTAX_SRCMASK
        sysRTAX_LABEL   = C.RTAX_LABEL
+       sysRTAX_BFD     = C.RTAX_BFD
+       sysRTAX_DNS     = C.RTAX_DNS
+       sysRTAX_STATIC  = C.RTAX_STATIC
+       sysRTAX_SEARCH  = C.RTAX_SEARCH
        sysRTAX_MAX     = C.RTAX_MAX
 )
 
index 61b2bb4add03fc357a356b8ac63a232e7b7372f7..02fa688309c27bcdd9f726234f3d7e77387701a1 100644 (file)
@@ -6,7 +6,10 @@
 
 package route
 
-import "syscall"
+import (
+       "runtime"
+       "syscall"
+)
 
 func (m *RouteMessage) marshal() ([]byte, error) {
        w, ok := wireFormats[m.Type]
@@ -14,6 +17,11 @@ func (m *RouteMessage) marshal() ([]byte, error) {
                return nil, errUnsupportedMessage
        }
        l := w.bodyOff + addrsSpace(m.Addrs)
+       if runtime.GOOS == "darwin" {
+               // Fix stray pointer writes on macOS.
+               // See golang.org/issue/22456.
+               l += 1024
+       }
        b := make([]byte, l)
        nativeEndian.PutUint16(b[:2], uint16(l))
        if m.Version == 0 {
index 63fd8c5618af4744bb15001e3c89587f4c542e4f..61bd1745431ef6a03b8c8314c2a693be28ce757a 100644 (file)
@@ -74,6 +74,10 @@ var addrAttrNames = [...]string{
        "df:mpls1-n:tag-o:src", // mpls1 for dragonfly, tag for netbsd, src for openbsd
        "df:mpls2-o:srcmask",   // mpls2 for dragonfly, srcmask for openbsd
        "df:mpls3-o:label",     // mpls3 for dragonfly, label for openbsd
+       "o:bfd",                // bfd for openbsd
+       "o:dns",                // dns for openbsd
+       "o:static",             // static for openbsd
+       "o:search",             // search for openbsd
 }
 
 func (attrs addrAttrs) String() string {
index e742c919db8e86812cb9211b7b477a6affb413ec..d2daf5c05aac23027ea03080f5de02d077d32da9 100644 (file)
@@ -13,7 +13,7 @@ func (typ RIBType) parseable() bool {
        }
 }
 
-// RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
 type RouteMetrics struct {
        PathMTU int // path maximum transmission unit
 }
@@ -30,7 +30,7 @@ func (m *RouteMessage) Sys() []Sys {
        }
 }
 
-// InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
 type InterfaceMetrics struct {
        Type int // interface type
        MTU  int // maximum transmission unit
index b175cb18cee07b6073740e666375555ed62202b7..0c14bc2b4d46d1a67d3a9a044e64957c68c63acd 100644 (file)
@@ -8,7 +8,7 @@ import "unsafe"
 
 func (typ RIBType) parseable() bool { return true }
 
-// RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
 type RouteMetrics struct {
        PathMTU int // path maximum transmission unit
 }
@@ -25,7 +25,7 @@ func (m *RouteMessage) Sys() []Sys {
        }
 }
 
-// InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
 type InterfaceMetrics struct {
        Type int // interface type
        MTU  int // maximum transmission unit
index 010d4ae7827e918055e73ef1d5577a28a4d97ffb..89ba1c4e26299c31bb3e27def735d8b744365970 100644 (file)
@@ -11,7 +11,7 @@ import (
 
 func (typ RIBType) parseable() bool { return true }
 
-// RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
 type RouteMetrics struct {
        PathMTU int // path maximum transmission unit
 }
@@ -35,7 +35,7 @@ func (m *RouteMessage) Sys() []Sys {
        }
 }
 
-// InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
 type InterfaceMetrics struct {
        Type int // interface type
        MTU  int // maximum transmission unit
index b4e330140315da6291689510b0e3025e2aa24a4e..02f71d54bbdfa6776826c1df09b96172a6bd1c9f 100644 (file)
@@ -6,7 +6,7 @@ package route
 
 func (typ RIBType) parseable() bool { return true }
 
-// RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
 type RouteMetrics struct {
        PathMTU int // path maximum transmission unit
 }
@@ -23,7 +23,7 @@ func (m *RouteMessage) Sys() []Sys {
        }
 }
 
-// A InterfaceMetrics represents interface metrics.
+// RouteMetrics represents route metrics.
 type InterfaceMetrics struct {
        Type int // interface type
        MTU  int // maximum transmission unit
index 8798dc4ca375bd69d4cc6282c9d13f04ab50a30f..c5674e83d0135019cf091daf54a0ae5fbc80b3ed 100644 (file)
@@ -15,7 +15,7 @@ func (typ RIBType) parseable() bool {
        }
 }
 
-// RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
 type RouteMetrics struct {
        PathMTU int // path maximum transmission unit
 }
@@ -32,7 +32,7 @@ func (m *RouteMessage) Sys() []Sys {
        }
 }
 
-// InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
 type InterfaceMetrics struct {
        Type int // interface type
        MTU  int // maximum transmission unit
@@ -75,5 +75,6 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
                sysRTM_DELADDR:    ifam,
                sysRTM_IFINFO:     ifm,
                sysRTM_IFANNOUNCE: ifanm,
+               sysRTM_DESYNC:     rtm,
        }
 }
index f5a1ff96731c7a55553b0f0cf1c435e0f58bd621..db8c8efb49b291a5b09f513a5db4543a876a7b79 100644 (file)
@@ -54,6 +54,9 @@ const (
        sysRTM_IFINFO     = 0xe
        sysRTM_IFANNOUNCE = 0xf
        sysRTM_DESYNC     = 0x10
+       sysRTM_INVALIDATE = 0x11
+       sysRTM_BFD        = 0x12
+       sysRTM_PROPOSAL   = 0x13
 
        sysRTA_DST     = 0x1
        sysRTA_GATEWAY = 0x2
@@ -66,6 +69,10 @@ const (
        sysRTA_SRC     = 0x100
        sysRTA_SRCMASK = 0x200
        sysRTA_LABEL   = 0x400
+       sysRTA_BFD     = 0x800
+       sysRTA_DNS     = 0x1000
+       sysRTA_STATIC  = 0x2000
+       sysRTA_SEARCH  = 0x4000
 
        sysRTAX_DST     = 0x0
        sysRTAX_GATEWAY = 0x1
@@ -78,7 +85,11 @@ const (
        sysRTAX_SRC     = 0x8
        sysRTAX_SRCMASK = 0x9
        sysRTAX_LABEL   = 0xa
-       sysRTAX_MAX     = 0xb
+       sysRTAX_BFD     = 0xb
+       sysRTAX_DNS     = 0xc
+       sysRTAX_STATIC  = 0xd
+       sysRTAX_SEARCH  = 0xe
+       sysRTAX_MAX     = 0xf
 )
 
 const (