Commit fa179eb8 authored by Mikio Hara's avatar Mikio Hara

vendor: update golang_org/x/net/route from upstream

Updates the route package to git rev 68fc911 for:
- 68fc911 re-adjust routing message alignment for FreeBSD 386 emulation
- 4dfa261 fix typos in comments
- ae89d30 avoid unnecessary type conversions

Change-Id: I915e614e464acf85a8fc80f36f05a85a9246bb01
Reviewed-on: https://go-review.googlesource.com/c/139817
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 80818620
......@@ -37,7 +37,7 @@ func (m *InterfaceAddrMessage) Sys() []Sys { return nil }
// address message.
type InterfaceMulticastAddrMessage struct {
Version int // message version
Type int // messsage type
Type int // message type
Flags int // interface flags
Index int // interface index
Addrs []Addr // addresses
......
......@@ -57,7 +57,7 @@ func (m *InterfaceMessage) Sys() []Sys {
func probeRoutingStack() (int, map[int]*wireFormat) {
var p uintptr
wordSize := int(unsafe.Sizeof(p))
align := int(unsafe.Sizeof(p))
align := wordSize
// In the case of kern.supported_archs="amd64 i386", we need
// to know the underlying kernel's architecture because the
// alignment for routing facilities are set at the build time
......@@ -129,6 +129,9 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
} else {
ifm.bodyOff = sizeofIfMsghdrFreeBSD11
}
if rel >= 1102000 { // see https://github.com/freebsd/freebsd/commit/027c7f4d66ff8d8c4a46c3665a5ee7d6d8462034#diff-ad4e5b7f1449ea3fc87bc97280de145b
align = wordSize
}
}
rtm.parse = rtm.parseRouteMessage
ifm.parse = ifm.parseInterfaceMessage
......
......@@ -20,7 +20,7 @@ func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr)
} else {
p = unsafe.Pointer(&zero)
}
_, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
_, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), newlen)
if errno != 0 {
return error(errno)
}
......
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