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>
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
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
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
)
package route
-import "syscall"
+import (
+ "runtime"
+ "syscall"
+)
func (m *RouteMessage) marshal() ([]byte, error) {
w, ok := wireFormats[m.Type]
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 {
"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 {
}
}
-// A RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
}
}
-// A InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
func (typ RIBType) parseable() bool { return true }
-// A RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
}
}
-// A InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
func (typ RIBType) parseable() bool { return true }
-// A RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
}
}
-// A InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
func (typ RIBType) parseable() bool { return true }
-// A RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
}
}
-// A InterfaceMetrics represents interface metrics.
+// RouteMetrics represents route metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
}
}
-// A RouteMetrics represents route metrics.
+// RouteMetrics represents route metrics.
type RouteMetrics struct {
PathMTU int // path maximum transmission unit
}
}
}
-// A InterfaceMetrics represents interface metrics.
+// InterfaceMetrics represents interface metrics.
type InterfaceMetrics struct {
Type int // interface type
MTU int // maximum transmission unit
sysRTM_DELADDR: ifam,
sysRTM_IFINFO: ifm,
sysRTM_IFANNOUNCE: ifanm,
+ sysRTM_DESYNC: rtm,
}
}
sysRTM_IFINFO = 0xe
sysRTM_IFANNOUNCE = 0xf
sysRTM_DESYNC = 0x10
+ sysRTM_INVALIDATE = 0x11
+ sysRTM_BFD = 0x12
+ sysRTM_PROPOSAL = 0x13
sysRTA_DST = 0x1
sysRTA_GATEWAY = 0x2
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
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 (