mirror of
https://github.com/golang/go
synced 2024-11-17 02:14:42 -07:00
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
808186203b
commit
fa179eb89d
@ -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
|
||||
|
2
src/vendor/golang_org/x/net/route/syscall.go
vendored
2
src/vendor/golang_org/x/net/route/syscall.go
vendored
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user