Skip to content

Commit

Permalink
vendor: update golang_org/x/net/route from upstream
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cixtor committed Oct 4, 2018
1 parent 8081862 commit fa179eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vendor/golang_org/x/net/route/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/vendor/golang_org/x/net/route/sys_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/golang_org/x/net/route/syscall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit fa179eb

Please sign in to comment.