Skip to content

Commit fa179eb

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 8081862 commit fa179eb

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/vendor/golang_org/x/net/route/interface.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (m *InterfaceAddrMessage) Sys() []Sys { return nil }
3737
// address message.
3838
type InterfaceMulticastAddrMessage struct {
3939
Version int // message version
40-
Type int // messsage type
40+
Type int // message type
4141
Flags int // interface flags
4242
Index int // interface index
4343
Addrs []Addr // addresses

src/vendor/golang_org/x/net/route/sys_freebsd.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (m *InterfaceMessage) Sys() []Sys {
5757
func probeRoutingStack() (int, map[int]*wireFormat) {
5858
var p uintptr
5959
wordSize := int(unsafe.Sizeof(p))
60-
align := int(unsafe.Sizeof(p))
60+
align := wordSize
6161
// In the case of kern.supported_archs="amd64 i386", we need
6262
// to know the underlying kernel's architecture because the
6363
// alignment for routing facilities are set at the build time
@@ -129,6 +129,9 @@ func probeRoutingStack() (int, map[int]*wireFormat) {
129129
} else {
130130
ifm.bodyOff = sizeofIfMsghdrFreeBSD11
131131
}
132+
if rel >= 1102000 { // see https://github.com/freebsd/freebsd/commit/027c7f4d66ff8d8c4a46c3665a5ee7d6d8462034#diff-ad4e5b7f1449ea3fc87bc97280de145b
133+
align = wordSize
134+
}
132135
}
133136
rtm.parse = rtm.parseRouteMessage
134137
ifm.parse = ifm.parseInterfaceMessage

src/vendor/golang_org/x/net/route/syscall.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr)
2020
} else {
2121
p = unsafe.Pointer(&zero)
2222
}
23-
_, _, 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))
23+
_, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), newlen)
2424
if errno != 0 {
2525
return error(errno)
2626
}

0 commit comments

Comments
 (0)